/* QSMovin Top Nav Prototype - Custom Styles */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* ============ TOP NAV ============ */

.topnav {
  background: var(--gray-900);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  max-width: 1440px;
  margin: 0 auto;
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.hamburger:hover {
  background: var(--gray-700);
}

.topnav-logo {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  text-decoration: none;
  margin-right: 16px;
  flex-shrink: 0;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-item {
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--gray-300);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.topnav-item:hover {
  background: var(--gray-700);
  color: white;
}

.topnav-item.active {
  background: var(--primary);
  color: white;
}

.topnav-dropdown-wrapper {
  position: relative;
}

.topnav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 220px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 6px;
  margin-top: 4px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.topnav-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topnav-subitem {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.topnav-subitem:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.topnav-subitem.active {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 500;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  animation: modalFadeIn 0.25s ease;
}

.mobile-overlay.show {
  display: block;
}

/* ============ MAIN CONTENT ============ */

.app-container {
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

.top-bar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 56px;
  z-index: 50;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-left h2 {
  font-size: 20px;
  font-weight: 600;
}

.breadcrumb {
  font-size: 13px;
  color: var(--gray-500);
}

.breadcrumb a {
  color: var(--primary-light);
  text-decoration: none;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============ PAGE CONTENT ============ */

.page-content {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.summary-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card .icon.blue { background: #dbeafe; color: var(--primary); }
.summary-card .icon.green { background: #dcfce7; color: var(--success); }
.summary-card .icon.orange { background: #fef3c7; color: var(--warning); }
.summary-card .icon.red { background: #fee2e2; color: var(--danger); }

.summary-card .info h3 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-card .info p {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--gray-50);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

tr:hover {
  background: var(--gray-50);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}

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

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  outline: none;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar .fill.blue { background: var(--primary-light); }
.progress-bar .fill.green { background: var(--success); }
.progress-bar .fill.orange { background: var(--warning); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal {
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Email Validation */
.email-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.email-status.valid { color: var(--success); }
.email-status.invalid { color: var(--danger); }
.email-status.unverified { color: var(--gray-400); }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--primary-light);
  background: #f0f7ff;
}

.upload-area svg {
  width: 48px;
  height: 48px;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.upload-area h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.upload-area p {
  font-size: 13px;
  color: var(--gray-500);
}

/* Faculty Progress */
.faculty-progress {
  margin-bottom: 20px;
}

.faculty-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.faculty-progress-header h4 {
  font-size: 14px;
  font-weight: 500;
}

.faculty-progress-header span {
  font-size: 13px;
  color: var(--gray-500);
}

/* Lang Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-700);
  border-radius: 6px;
  padding: 4px;
  font-size: 12px;
}

.lang-toggle button {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: transparent;
  color: var(--gray-400);
  transition: all 0.2s;
}

.lang-toggle button.active {
  background: white;
  color: var(--gray-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  border-left: 4px solid var(--success);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.notification-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .logo-large {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: white;
  font-weight: 700;
  font-size: 22px;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card .lang-toggle {
  background: var(--gray-100);
  display: inline-flex;
}

.login-card .lang-toggle button {
  color: var(--gray-600);
}

.login-card .lang-toggle button.active {
  background: white;
  color: var(--gray-900);
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-microsoft:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* Consent Page */
.consent-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}

.consent-card {
  background: white;
  border-radius: 16px;
  padding: 48px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.consent-card .university-logo {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: white;
  font-weight: 700;
  font-size: 28px;
}

.consent-card .lang-toggle {
  background: var(--gray-100);
  display: inline-flex;
}

.consent-card .lang-toggle button.active {
  background: white;
  color: var(--gray-900);
}

/* Nav Icons */
.nav-icon {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

.subnav-icon {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 8px;
}

.arrow-down {
  margin-left: 4px;
  font-size: 11px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.15s;
}

.header-icon-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.header-icon-btn .material-icons {
  font-size: 22px;
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid white;
}

/* Target Cell */
.target-cell {
  display: inline-flex;
  align-items: center;
}

.target-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-700);
  padding: 6px 10px;
  display: none;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background: var(--primary);
}

/* Dashboard Filters */
.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-filters .form-select {
  padding: 8px 12px;
  font-size: 13px;
  min-width: 160px;
  width: auto;
}

/* Permission Checkboxes */
.perm-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.perm-checkbox:hover {
  background: var(--gray-50);
}

/* Icon Button */
.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
}

.btn-icon:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-icon-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-icon-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #b91c1c;
}

.perm-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .topnav-links {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--gray-900);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px;
    z-index: 110;
    overflow-y: auto;
    gap: 2px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .topnav-links.show {
    transform: translateX(0);
  }

  .topnav-links,
  .topnav-links.show {
    display: flex;
  }

  .topnav-logo {
    margin-right: 0;
  }

  .topnav-dropdown-wrapper {
    width: 100%;
  }

  .topnav-dropdown {
    position: static;
    box-shadow: none;
    background: var(--gray-800);
    border-radius: 8px;
    margin-top: 2px;
    margin-bottom: 4px;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .topnav-dropdown.show {
    opacity: 1;
    pointer-events: auto;
  }

  .topnav-subitem {
    color: var(--gray-300);
  }

  .topnav-subitem:hover {
    background: var(--gray-700);
    color: white;
  }

  .topnav-item {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-filters {
    flex-direction: column;
    align-items: stretch;
  }
}
