/* ==========================================
   SAROK ARCHIVE - AMBER DARK THEME
   Classic, calm, beautiful
   ========================================== */

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #141414;
  --bg-card: #0f0f0f;
  --bg-sidebar: #080808;
  --bg-input: #1a1a1a;
  
  --border-subtle: #222222;
  --border-light: #2a2a2a;
  
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #606060;
  
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-subtle: rgba(245, 158, 11, 0.15);
  --accent-glow: rgba(245, 158, 11, 0.3);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  
  --sidebar-width: 72px;
  
  --font-main: 'Noto Sans Arabic', 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 50%, #080808 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
   SIDEBAR
   Narrow icons-only navigation
   ========================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  z-index: 100;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.sidebar-logo:hover {
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
}

.sidebar-nav,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-btn:hover {
  background: var(--bg-input);
  color: var(--accent);
}

.sidebar-btn.active {
  background: var(--accent);
  color: #000;
  box-shadow: var(--shadow-glow);
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  width: 48px;
  height: 48px;
  background: var(--bg-sidebar);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-header h2 i {
  color: var(--accent);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ==========================================
   HOME PAGE
   Minimal profile
   ========================================== */
.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.profile-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
}

.tool-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-subtle);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--accent);
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.tool-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tool-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.tool-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.badge {
  background: var(--accent);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.downloads {
  color: var(--text-muted);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ==========================================
   FILTERS & SEARCH
   ========================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent);
  color: #000;
}

.search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
}

.search-box input:focus {
  outline: none;
  box-shadow: var(--shadow-md), 0 0 0 2px var(--accent);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ==========================================
   BLOG CARDS
   ========================================== */
.blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.blog-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 1rem;
}

.read-more {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
}

.read-more:hover {
  color: var(--accent-hover);
}

/* ==========================================
   CHAT
   ========================================== */
.chat-page {
  max-width: 640px;
  margin: 0 auto;
}

.chat-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.chat-header h2 {
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.chat-messages {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  min-height: 400px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
}

.chat-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.chat-form {
  display: flex;
  gap: 0.75rem;
}

.chat-form input {
  flex: 1;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
}

.chat-form input:focus {
  outline: none;
  box-shadow: var(--shadow-md), 0 0 0 2px var(--accent);
}

.chat-form button {
  padding: 0.875rem 1.25rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #000;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-form button:hover {
  background: var(--accent-hover);
}

/* ==========================================
   AUTH / LOGIN
   ========================================== */
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.auth-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.auth-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-card > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem;
  background: #fff;
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-btn:hover {
  background: var(--accent);
}

.google-btn img {
  width: 20px;
  height: 20px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-toggle {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-toggle span {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.error-msg {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius);
  color: #ef4444;
  font-size: 0.8125rem;
}

/* ==========================================
   PROFILE
   ========================================== */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.profile-card i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.profile-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-glow);
}

.email {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.stat-box {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   ADMIN
   ========================================== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.admin-card:hover {
  box-shadow: var(--shadow-lg);
}

.admin-card i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.admin-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.admin-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.admin-tab {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  background: var(--bg-input);
}

.admin-tab.active {
  background: var(--accent);
  color: #000;
}

/* ==========================================
   LOADING & EMPTY STATES
   ========================================== */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-state i,
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .overlay {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem;
    padding-top: 4.5rem;
  }

  .tools-grid,
  .blogs-grid {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    gap: 1rem;
  }

  .admin-tabs {
    flex-direction: column;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }