/* Modern Dark Theme - Professional Exam System */
:root {
  --primary-color: #ff6b00;
  --primary-hover: #ff8a33;
  --secondary-color: #6366f1;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --bg-primary: linear-gradient(135deg, #0b0a1a 0%, #2a0b3f 100%);
  --bg-secondary: rgba(16,25,35,0.95);
  --bg-tertiary: rgba(30,42,59,0.8);
  --text-primary: #e6edf3;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: #374151;
  --border-light: #4b5563;
  --shadow: 0 10px 25px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Container */
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
  margin: 0 0 16px;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 2rem; color: var(--text-primary); }
h3 { font-size: 1.5rem; color: var(--text-primary); }

p { margin: 0 0 16px; }

a { 
  color: var(--primary-color); 
  text-decoration: none;
  transition: var(--transition);
}
a:hover { 
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Cards / Panels */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: var(--transition);
}

.card:hover::before {
  opacity: 1;
}

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

/* Form Controls */
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
  background: rgba(16,25,35,1);
}

textarea { 
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.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: var(--transition);
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 0, 0.4);
  background: linear-gradient(135deg, var(--primary-hover), #ff9f4d);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
}

/* Flex Helpers */
.row { 
  display: flex; 
  gap: 20px;
  flex-wrap: wrap;
}
.col { 
  flex: 1 1 0;
  min-width: 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Tables */
table { 
  width: 100%; 
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td { 
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th { 
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(255, 107, 0, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Status Indicators */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning-color);
}

.status-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error-color);
}

.status-info {
  background: rgba(99, 102, 241, 0.2);
  color: var(--secondary-color);
}

/* Progress Bars */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Timer */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--warning-color);
}

.timer.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-color);
  color: var(--warning-color);
  animation: pulse 2s infinite;
}

.timer.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error-color);
  color: var(--error-color);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* File Upload */
.file-upload {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-upload input[type=file] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.file-upload-label:hover {
  border-color: var(--primary-color);
  background: rgba(255, 107, 0, 0.05);
}

.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  color: white;
  font-weight: 600;
  z-index: 1000;
  transform: translateX(400px);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
}

.notification-error {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
}

.notification-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.notification-info {
  background: linear-gradient(135deg, var(--secondary-color), #4f46e5);
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal.show .modal-content {
  transform: scale(1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  .row { 
    flex-direction: column;
    gap: 16px;
  }
  
  .card {
    padding: 20px;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  table {
    font-size: 14px;
  }
  
  th, td {
    padding: 12px 8px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .notification {
    right: 16px;
    left: 16px;
    transform: translateY(-100px);
  }
  
  .notification.show {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px;
  }
  
  .card {
    padding: 16px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* Print Styles */
/* File icon styles */
.file-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Image preview styles */
.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.02);
}

/* File upload disabled state */
.file-upload-disabled {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    opacity: 0.7;
}

.file-upload-disabled .warning-icon {
    color: var(--warning-color);
    margin-bottom: 12px;
}

/* Enhanced modal styles */
.modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  
  .btn {
    display: none !important;
  }
}
