/* ============================================
   AI Forward Portal — Dark Theme
   Colors:
     Orange:    #FF6900
     Navy:      #263654
     Deep navy: #1A2740
     Background:#0D1B2A
     Blue:      #1258CA
   Font: Plus Jakarta Sans
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0D1B2A;
  color: rgba(255, 255, 255, 0.88);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: #FF6900;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #ff8533;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0D1B2A;
}
::-webkit-scrollbar-thumb {
  background: #263654;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #1258CA;
}

/* --- Header --- */
.site-header {
  background: #1A2740;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.header-logo:hover {
  color: #fff;
}

.header-logo-img {
  height: 36px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.65);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-user-name {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Main content --- */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

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

.btn-primary {
  background: #FF6900;
  color: #fff;
}
.btn-primary:hover {
  background: #e65e00;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 105, 0, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

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

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
}
.btn-full:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Flash messages --- */
.flash {
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

.flash-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.flash-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 4px;
}
.flash-close:hover {
  opacity: 1;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Login Page --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0D1B2A;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: #1A2740;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-img {
  height: 80px;
  width: auto;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Forms --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}

.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  transition: all 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #FF6900;
  box-shadow: 0 0 0 3px rgba(255, 105, 0, 0.15);
}

.form-group select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group select option {
  background: #1A2740;
  color: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* --- Dashboard --- */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.page-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  width: 280px;
  transition: all 0.2s;
}
.search-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.search-input:focus {
  outline: none;
  border-color: #1258CA;
  box-shadow: 0 0 0 3px rgba(18, 88, 202, 0.15);
}

/* --- Cards grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* --- Presentation card --- */
.card {
  background: #1A2740;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 105, 0, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 105, 0, 0.1);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-thumbnail {
  aspect-ratio: 16 / 9;
  background: #0D1B2A;
  overflow: hidden;
  position: relative;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-thumbnail img {
  transform: scale(1.03);
}

.card-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #1A2740 0%, #263654 100%);
}

.card-initials {
  font-size: 36px;
  font-weight: 800;
  color: rgba(255, 105, 0, 0.35);
  letter-spacing: 2px;
  user-select: none;
}

.card-icon {
  color: rgba(255, 105, 0, 0.4);
  margin-bottom: 10px;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-client {
  font-size: 13px;
  color: #FF6900;
  font-weight: 500;
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.card-actions .btn {
  flex: 1;
  justify-content: center;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: rgba(255, 255, 255, 0.3);
}
.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 {
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  margin-bottom: 8px;
}
.empty-state p {
  margin-bottom: 24px;
  font-size: 14px;
}

/* --- Upload page --- */
.upload-page {
  max-width: 720px;
  margin: 0 auto;
}

.page-header-back {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  transition: color 0.2s;
}
.btn-back:hover {
  color: #fff;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: #FF6900;
  background: rgba(255, 105, 0, 0.04);
}

.dropzone-content {
  color: rgba(255, 255, 255, 0.4);
}
.dropzone-content svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.dropzone-text {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
}

.dropzone-file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #FF6900;
  font-weight: 500;
}
.dropzone-file svg {
  opacity: 0.7;
}

#file-size {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

/* --- Progress bar --- */
.progress-container {
  margin-top: -8px;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6900, #ff8533);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  text-align: center;
}

/* --- Upload status --- */
.upload-status {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}
.upload-status.status-processing {
  background: rgba(18, 88, 202, 0.12);
  border: 1px solid rgba(18, 88, 202, 0.2);
  color: #60a5fa;
}
.upload-status.status-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.upload-status.status-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* --- Users page --- */
.users-page {
  max-width: 960px;
  margin: 0 auto;
}

.card-form {
  background: #1A2740;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.card-form h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Data table --- */
.table-container {
  background: #1A2740;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-admin {
  background: rgba(255, 105, 0, 0.15);
  color: #FF6900;
}

.badge-collaborator {
  background: rgba(18, 88, 202, 0.15);
  color: #60a5fa;
}

/* --- Utility --- */
.text-muted {
  color: rgba(255, 255, 255, 0.25);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }
  .main-content {
    padding: 20px 16px;
  }
  .dashboard-header {
    flex-direction: column;
  }
  .dashboard-actions {
    width: 100%;
    flex-direction: column;
  }
  .search-input {
    width: 100%;
  }
  .nav-user-name {
    display: none;
  }
  .data-table {
    font-size: 13px;
  }
  .data-table th, .data-table td {
    padding: 10px 12px;
  }
}
