/* base.css - استایل‌های مشترک و متغیرهای CSS */

/* CSS Variables - متغیرهای مشترک */
:root {
  /* رنگ‌های اصلی */
  --primary-blue: #2563eb;
  --light-blue: #eff6ff;
  --dark-blue: #1e40af;
  --accent-blue: #3b82f6;

  /* گرادیان‌ها */
  --gradient-primary: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  --gradient-secondary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --gradient-accent: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);

  /* شیشه‌ای و شفافیت */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-bg-strong: rgba(255, 255, 255, 0.25);
  --glass-blur: blur(10px);

  /* سایه‌ها */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.15);

  /* متن */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-light: #6b7280;

  /* اندازه‌ها */
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.2s ease;
  --sidebar-width: 300px;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Container Styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Common Header Styles */
.common-header {
  background: var(--gradient-primary);
  padding: 1rem 0;
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2rem;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.75rem;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
}

.brand-text {
  color: white;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
  font-size: 0.9rem;
  margin: 0.25rem 0 0 0;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-back-home {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-back-home:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-new-chat {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-blue);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-new-chat:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-auth {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-auth:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-auth.logged-in {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-blue);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-auth.logged-in:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* Common Button Styles */
.btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.btn:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-primary {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--dark-blue);
  border-color: var(--dark-blue);
}

/* Input Styles */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.chat-input,
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
}

.chat-input::placeholder,
.search-input::placeholder {
  color: var(--text-light);
}

.input-actions {
  display: flex;
  gap: 0.5rem;
  margin-right: 1rem;
}

.input-actions .btn {
  padding: 0.5rem;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
}

.input-actions .btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  transform: none;
}

.btn-send {
  background: var(--primary-blue) !important;
  color: white !important;
  border-color: var(--primary-blue) !important;
}

.btn-send:hover {
  background: var(--dark-blue) !important;
  border-color: var(--dark-blue) !important;
  transform: translateY(-1px);
}

/* Glass Container Styles */
.glass-container {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Voice Status */
.voice-status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.voice-status-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}

.voice-status i {
  font-size: 1.2rem;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Modal Styles */
.modal {
  direction: rtl;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex !important;
}

.modal-content {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-strong);
  border: none;
}

.modal-header {
  background: var(--gradient-primary);
  color: white;
  border-bottom: none;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
  font-weight: 600;
  margin: 0;
}

.btn-close {
  color: white;
  opacity: 0.8;
  font-size: 1.2rem;
}

.btn-close:hover {
  opacity: 1;
  color: white;
}

.modal-body {
  padding: 2rem;
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-family: 'Vazirmatn', sans-serif;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.user-avatar {
  color: var(--primary-blue);
}

.text-decoration-none {
  color: var(--primary-blue);
  font-weight: 500;
}

.text-decoration-none:hover {
  color: var(--dark-blue);
  text-decoration: underline !important;
}

/* Loading States */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error Messages */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Success Messages */
.success-message {
  color: #059669;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .logo-section {
    justify-content: center;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .logo-icon {
    font-size: 1.5rem;
    padding: 0.5rem;
  }

  .header-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .input-group {
    flex-direction: column;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .logo-icon {
    font-size: 1.3rem;
    padding: 0.4rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}