/* Mobile-First CSS for PDF Summarizer */

/* CSS Variables for theming */
:root {
  --primary-color: #667eea;
  --primary-dark: #5a6fd8;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --background-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --surface-color: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --text-color: #2d3748;
  --text-secondary: #4a5568;
  --border-color: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.15);
  --shadow-3d: 0 20px 60px rgba(0,0,0,0.2);
  --border-radius: 20px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme (default) */
[data-theme="light"] {
  --background-color: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
  --surface-color: rgba(255, 255, 255, 0.98) !important;
  --text-color: #1a202c !important;
  --text-secondary: #2d3748 !important;
  --border-color: rgba(0, 0, 0, 0.1) !important;
  --shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.18) !important;
  --glass-bg: rgba(255, 255, 255, 0.8) !important;
}

/* Light theme sidebar text visibility */
[data-theme="light"] .sidebar {
  background: var(--glass-bg);
  border-right: 1px solid var(--border-color);
}

[data-theme="light"] .nav-link {
  color: #1a202c !important;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  background: rgba(33, 150, 243, 0.1) !important;
  border-left-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

[data-theme="light"] .nav-text {
  color: #1a202c !important;
}

[data-theme="light"] .nav-icon {
  color: #1a202c !important;
}

[data-theme="light"] .user-details h3 {
  color: #1a202c !important;
}

[data-theme="light"] .user-details p {
  color: #2d3748 !important;
}

[data-theme="light"] .logout-btn {
  background: #ff4444 !important;
  color: white !important;
}

[data-theme="light"] .logout-btn:hover {
  background: #cc3333 !important;
}

/* Dark theme */
[data-theme="dark"] {
  --background-color: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  --surface-color: rgba(30, 30, 30, 0.95) !important;
  --text-color: #ffffff !important;
  --text-secondary: #b0b0b0 !important;
  --border-color: rgba(255, 255, 255, 0.1) !important;
  --shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Smooth transitions for theme changes */
* {
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Light theme background overlay */
[data-theme="light"] body::before {
  background: 
    radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.08) 0%, transparent 50%);
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--primary-color);
  color: white;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

/* Mobile sidebar styles - ONLY on mobile */
@media (max-width: 767px) {
  .mobile-header {
    display: flex !important;
  }
  
  .hamburger {
    display: block !important;
  }
  
  .sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--surface-color);
    overflow-x: hidden;
    transition: width 0.3s ease;
    padding-top: 60px;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
  
  .sidebar.open {
    width: 150px;
  }
  
  .main-content {
    margin-left: 0;
    margin-top: 60px;
    padding: 16px;
    transition: margin-left 0.3s;
  }
  
  /* Mobile Summary Actions */
  .summary-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }
  
  .action-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    text-align: center;
    margin: 0;
  }
  
  /* Mobile Summarize Button */
  .summarize-btn {
    padding: 18px 24px;
    font-size: 16px;
    margin-bottom: 20px;
  }
  
  /* Mobile Content Sections */
  .content-section {
    padding: 20px 16px;
    margin-bottom: 16px;
  }
  
  /* Mobile Summary Output */
  .summary-output {
    margin-top: 20px;
  }
  
  /* Mobile Edit Controls */
  .edit-controls {
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }
  
  .edit-controls button {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  /* Mobile Save Message */
  .save-message {
    padding: 16px;
    margin: 20px 0;
    text-align: center;
    font-size: 16px;
  }
  
  /* Mobile Auth Prompt */
  .auth-prompt {
    padding: 20px 16px;
    margin: 20px 0;
    text-align: center;
  }
  
  .auth-prompt h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .auth-prompt p {
    font-size: 16px;
    line-height: 1.5;
  }
  
  /* Mobile Upload Area */
  .upload-area {
    padding: 30px 20px;
    margin: 20px 0;
  }
  
  .upload-area h3 {
    font-size: 20px;
    margin-bottom: 16px;
  }
  
  .upload-area p {
    font-size: 16px;
    margin-bottom: 20px;
  }
  
  /* Mobile Summary Content */
  .summary-content {
    padding: 16px;
    font-size: 16px;
    line-height: 1.6;
  }
  
  /* Mobile Textarea */
  #summaryContent {
    font-size: 16px;
    padding: 16px;
    line-height: 1.6;
    min-height: 200px;
  }
}

.hamburger {
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  border: none;
  margin-right: 10px;
}

.mobile-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.theme-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-3d);
  z-index: 1001;
  transition: var(--transition);
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  padding: 20px;
  background: var(--primary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-sidebar {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-content {
  padding: 20px 0;
}

/* User Section */
.user-section {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-details h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.user-details p {
  font-size: 12px;
  color: var(--text-secondary);
}

.logout-btn {
  width: 100%;
  padding: 8px 16px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover {
  background: #cc3333;
}

/* Navigation Menu */
.nav-menu {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(33, 150, 243, 0.1);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 16px;
  font-weight: 500;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content */
.main-content {
  margin-top: 60px;
  padding: 20px;
  min-height: calc(100vh - 60px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.content-section {
  display: none;
  animation: fadeIn 0.3s ease;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-3d);
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Upload Area */
.upload-area {
  background: var(--surface-color);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(33, 150, 243, 0.05);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(33, 150, 243, 0.1);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-area h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-area p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.upload-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.upload-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.upload-btn:hover::before {
  left: 100%;
}

.upload-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

/* File Info */
.file-info {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.file-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  font-size: 24px;
}

.file-text {
  flex: 1;
}

.file-text h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.file-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

.remove-file {
  background: #ff4444;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.remove-file:hover {
  background: #cc3333;
}

/* PDF Controls */
.pdf-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-bottom: 1px solid var(--border-color);
}

.control-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.control-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.control-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.page-info {
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* PDF Viewer Frame */
.pdf-viewer-frame {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid var(--border-color);
}

/* PDF Container */
.pdf-container {
  background: var(--surface-color);
  min-height: 500px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.no-pdf {
  text-align: center;
  color: var(--text-secondary);
}

.no-pdf-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-pdf h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

/* Summarize Options */
.summarize-options {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.option-group {
  margin-bottom: 16px;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-color);
}

.option-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 14px;
}

/* Summarize Button */
.summarize-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  padding: 20px;
  border-radius: var(--border-radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summarize-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

.summarize-btn:hover::before {
  left: 100%;
}

.summarize-btn:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
}

.summarize-btn:disabled {
  background: var(--border-color);
  cursor: not-allowed;
  transform: none;
}

/* Summary Output */
.summary-output {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-header {
  background: var(--primary-color);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.summary-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.action-btn:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.2));
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-hover);
}

/* Light theme action buttons */
[data-theme="light"] .action-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow);
}

[data-theme="light"] .action-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-hover);
}

/* Light theme sidebar */
[data-theme="light"] .sidebar {
  background: var(--glass-bg);
  border-right: 1px solid var(--border-color);
}

/* Light theme content sections */
[data-theme="light"] .content-section {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
}

.summary-content {
  padding: 20px;
  line-height: 1.8;
  font-size: 14px;
}

/* Auth Prompt */
.auth-prompt {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-prompt h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-prompt p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.auth-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.auth-btn.primary {
  background: var(--primary-color);
  color: white;
}

.auth-btn.primary:hover {
  background: var(--primary-dark);
}

.auth-btn.secondary {
  background: var(--border-color);
  color: var(--text-color);
}

.auth-btn.secondary:hover {
  background: var(--text-secondary);
  color: white;
}

/* Summaries List */
.summaries-header {
  margin-bottom: 20px;
}

.load-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.load-btn:hover {
  background: var(--primary-dark);
}

.summaries-container {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-summaries {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
}

.no-summaries-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-summaries h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

/* Settings */
.settings-group {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.settings-group h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item label {
  font-size: 14px;
  font-weight: 500;
}

.setting-item select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 14px;
}

.about-info {
  text-align: center;
  color: var(--text-secondary);
}

.about-info p {
  margin-bottom: 8px;
}

.about-info strong {
  color: var(--text-color);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-hover);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}

.modal-body {
  padding: 20px;
}

/* Auth Forms */
.auth-form {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.submit-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}

.submit-btn:hover {
  background: var(--primary-dark);
}

.form-footer {
  text-align: center;
}

.form-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
}

.form-footer a:hover {
  text-decoration: underline;
}

.form-footer p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 768px) {
  .sidebar {
    left: 0;
    width: 280px;
    transform: none !important;
  }
  
  .main-content {
    margin-left: 280px;
    margin-top: 0;
    padding: 20px;
  }
  
  .mobile-header {
    display: none;
  }
  
  .hamburger {
    display: none !important;
  }
  
  .sidebar-overlay {
    display: none;
  }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
  .nav-link:hover,
  .upload-btn:hover,
  .summarize-btn:hover,
  .action-btn:hover,
  .auth-btn:hover,
  .control-btn:hover {
    transform: none;
  }
  
  .nav-link:active,
  .upload-btn:active,
  .summarize-btn:active,
  .action-btn:active,
  .auth-btn:active,
  .control-btn:active {
    transform: scale(0.95);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
}

/* Notifications */
.notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 4000;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.notification-success {
  background: #4CAF50;
  color: white;
}

.notification-error {
  background: #ff4444;
  color: white;
}

.notification-info {
  background: #2196F3;
  color: white;
}