/* Chat Egy - Main CSS */

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --dark-bg: #1f2937;
  --light-bg: #f9fafb;
  --text-dark: #111827;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #fff;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Navigation Bar */
.navbar {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
  padding-bottom: 0.25rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Cairo', sans-serif;
}

.auth-btn {
  background-color: var(--primary-color);
  color: white;
}

.auth-btn:hover {
  background-color: var(--primary-dark);
}

.install-btn {
  background-color: var(--secondary-color);
  color: white;
}

.install-btn:hover {
  background-color: #059669;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero .container {
  max-width: 800px;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 2px solid white;
}

.btn-secondary:hover {
  background-color: transparent;
  color: white;
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn.full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Topics Section */
.topics-section {
  padding: 4rem 0;
  background-color: var(--light-bg);
}

.topics-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.topic-card {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.topic-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.topic-content {
  padding: 1.5rem;
}

.topic-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.topic-description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.topic-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.topic-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.topic-date {
  color: var(--text-light);
}

.topic-actions {
  display: flex;
  gap: 0.5rem;
}

.topic-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
}

.download-btn {
  background-color: var(--primary-color);
  color: white;
}

.download-btn:hover {
  background-color: var(--primary-dark);
}

.share-btn {
  background-color: var(--light-bg);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.share-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.topic-card.loading {
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, var(--light-bg) 25%, #e0e0e0 50%, var(--light-bg) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  height: 20px;
  border-radius: 0.4rem;
  margin-bottom: 1rem;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover {
  color: var(--text-dark);
}

/* Auth Container */
.auth-container {
  padding: 2rem;
}

.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  font-family: 'Cairo', sans-serif;
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

.auth-form input:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  color: var(--text-light);
}

.checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.forgot-password {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Dashboard */
.user-dashboard {
  padding: 3rem 0;
}

.user-dashboard h2 {
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.dashboard-card {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.dashboard-card h3 {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.stat {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-color);
}

/* Footer */
.footer {
  background: var(--dark-bg);
  color: white;
  padding: 3rem 0;
  text-align: center;
  margin-top: 4rem;
}

.footer p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer a:hover {
  color: white;
  text-decoration: none;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }

/* Loading State */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--light-bg);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success/Error Messages */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-info {
  background-color: #dbeafe;
  color: #0c2d6b;
  border: 1px solid #bfdbfe;
}
