/* ==============================
   USER DASHBOARD STYLES - MOBILE OPTIMIZED
   ============================== */

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

/* Main Container */
.user-dashboard-container {
  display: flex;
  min-height: 100vh;
  background: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  flex-wrap: nowrap;
}

/* Mobile Menu Toggle */
.user-mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 100px;
  left: 66px;
  z-index: 1101;
  background: #3498db;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.user-mobile-menu-toggle:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

/* Mobile Overlay */
.user-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.user-mobile-overlay.active {
  display: block;
}

/* Sidebar Styles - WHITE BACKGROUND - STICKY POSITION */
.user-sidebar {
  width: 280px;
  position: sticky;
  top: 80px;
  left: 0;
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  background: #ffffff;
  color: #2c3e50;
  padding-top: 20px;
  padding-bottom: 20px;
  z-index: 999;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border-right: 1px solid #e0e0e0;
  align-self: flex-start;
}

.user-sidebar.collapsed {
  width: 80px;
}

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

.sidebar-toggle {
  position: absolute;
  top: 20px;
  right: -15px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
  background: #f0f0f0;
}

.user-sidebar-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.user-sidebar-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  transition: opacity 0.3s ease;
}

.user-sidebar.collapsed .user-sidebar-header h1 {
  opacity: 0;
  font-size: 0;
}

.user-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.user-nav-item,
.user-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border: none;
  background: transparent;
  color: #5a6c7d;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.user-nav-item:hover,
.user-sidebar-nav a:hover,
.user-nav-item-active,
.user-sidebar-nav a.active {
  background: #f8f9fa;
  color: #3498db;
  border-radius: 6px;
  border-left-color: #3498db;
}

.user-nav-item-logout {
  color: #e74c3c;
  margin-top: auto;
}

.user-nav-item-logout:hover {
  color: #c0392b;
  border-left-color: #e74c3c;
}

.user-sidebar-nav a .icon {
  font-size: 20px;
  margin-right: 15px;
  min-width: 20px;
}

.user-sidebar.collapsed .user-sidebar-nav a span:not(.icon):not(.notif-badge) {
  display: none;
}

.notif-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 12px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-sidebar.collapsed .notif-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  margin-left: 0;
}

/* Main Content Area */
.user-main-content {
  flex: 1;
  margin-left: 0;
  margin-top: 80px;
  padding: 30px;
  padding-bottom: 140px;
  transition: margin-left 0.3s ease-in-out;
  min-height: calc(100vh - 80px);
}

.user-sidebar.collapsed ~ .user-main-content {
  margin-left: 0;
}

.user-content-header {
  margin-bottom: 2rem;
}

.user-content-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.user-content-body {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-content-body h2,
.user-tab-content h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 25px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-content-body h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: #3498db;
  margin-right: 12px;
  border-radius: 2px;
}

.user-tab-content p {
  color: #64748b;
  margin-bottom: 2rem;
  text-align: center;
}

/* Stats Grid */
.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Stat Cards */
.user-stat-card {
  background: #fff;
  border: 2px solid #e8ecef;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  animation: fadeInUp 0.6s ease forwards;
}

.user-stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: #3498db;
}

.user-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
}

.user-stat-card h3 {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.user-stat-card p {
  font-size: 32px;
  color: #2c3e50;
  font-weight: 700;
}

/* Card Themes */
.user-stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.user-stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.user-stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, #f97316, #ea580c);
}

.user-stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #eab308, #d97706);
}

/* Multi-Step Upload Form */
.upload-form-container {
  max-width: 700px;
  margin: 0 auto;
}

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

.form-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.form-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
  z-index: 0;
}

.progress-line {
  position: absolute;
  top: 20px;
  left: 0;
  height: 3px;
  background: #3498db;
  transition: width 0.3s ease;
  z-index: 1;
}

.form-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  position: relative;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #95a5a6;
  transition: all 0.3s ease;
}

.step-circle.active {
  border-color: #3498db;
  background: #3498db;
  color: white;
}

.step-circle.completed {
  border-color: #27ae60;
  background: #27ae60;
  color: white;
}

.step-label {
  margin-top: 8px;
  font-size: 12px;
  color: #95a5a6;
  font-weight: 500;
}

.step-circle.active ~ .step-label,
.step-circle.completed ~ .step-label {
  color: #2c3e50;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.upload-form label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
  font-size: 14px;
}

.upload-form input[type="text"],
.upload-form input[type="email"],
.upload-form input[type="file"],
.upload-form input[type="password"],
.upload-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.upload-form input:focus,
.upload-form textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.upload-form input[readonly] {
  background: #f8f9fa;
  cursor: not-allowed;
}

.checkbox-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 25px;
}

.checkbox-confirm input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}

.checkbox-confirm label {
  margin: 0;
  cursor: pointer;
}

.form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-prev {
  background: #ecf0f1;
  color: #2c3e50;
}

.btn-prev:hover {
  background: #d5dbdb;
}

.btn-next,
.submit-btn {
  background: #3498db;
  color: white;
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-next:hover,
.submit-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.submit-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

/* Submissions Table */
.submissions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.submissions-table thead {
  background-color: #3498db;
  color: #ffffff;
}

.submissions-table th,
.submissions-table td {
  padding: 15px;
  text-align: left;
  font-size: 14px;
}

.submissions-table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e0e0e0;
}

.submissions-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.submissions-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.submissions-table tbody tr:hover {
  background-color: #f1f5f9;
  cursor: pointer;
}

.submissions-table td {
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.submissions-table a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.submissions-table a:hover {
  text-decoration: underline;
}

/* Notifications */
.user-notifications {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.notifications-section h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 20px;
  font-weight: 600;
}

.notification-list {
  list-style: none;
}

.notification-list li {
  padding: 15px;
  border-left: 4px solid #e0e0e0;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.notification-list li.unread {
  border-left-color: #3498db;
  background: #ebf5fb;
}

.notification-list li strong {
  color: #2c3e50;
  font-size: 13px;
}

.mark-read-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: #3498db;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mark-read-btn:hover {
  background: #2980b9;
}

/* Reset Password Form */
.reset-password-form {
  max-width: 500px;
  margin: 30px auto;
  padding: 25px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.reset-password-form label {
  font-weight: 500;
  color: #444;
  margin-bottom: 5px;
}

.reset-password-form input[type="password"] {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.reset-password-form input[type="password"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}

.reset-password-form .submit-btn {
  background-color: #007bff;
  color: #fff;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.reset-password-form .submit-btn:hover {
  background-color: #0056b3;
}

/* Flash Messages */
.flash-message {
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.flash-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

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

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

.user-stat-card:nth-child(1) { animation-delay: 0.1s; }
.user-stat-card:nth-child(2) { animation-delay: 0.2s; }
.user-stat-card:nth-child(3) { animation-delay: 0.3s; }
.user-stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ==============================
   RESPONSIVE MOBILE STYLES
   ============================== */

@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .user-mobile-menu-toggle {
    display: block;
  }

  /* Sidebar for mobile */
  .user-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    transform: translateX(-100%);
    z-index: 1000;
    padding-top: 80px;
  }

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

  /* Hide desktop toggle on mobile */
  .sidebar-toggle {
    display: none;
  }

  /* Main content adjustments */
  .user-main-content {
    margin-left: 0;
    margin-top: 80px;
    padding: 20px 15px;
    padding-top: 30px;
    padding-bottom: 100px;
    width: 100%;
  }

  /* Content body padding */
  .user-content-body {
    padding: 20px 15px;
    border-radius: 8px;
  }

  .user-notifications {
    padding: 20px 15px;
  }

  /* Header adjustments */
  .user-content-header h1 {
    font-size: 1.5rem;
  }

  .user-content-body h2 {
    font-size: 1.25rem;
    flex-direction: column;
    text-align: center;
  }

  .user-content-body h2::before {
    display: none;
  }

  /* Stats grid - 2 columns on tablet */
  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .user-stat-card {
    padding: 20px 15px;
  }

  .user-stat-card p {
    font-size: 28px;
  }

  /* Form progress - scrollable on mobile */
  .form-progress {
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 30px;
  }

  .form-step-indicator {
    min-width: 60px;
  }

  .step-label {
    font-size: 10px;
    white-space: nowrap;
  }

  /* Form buttons stack on mobile */
  .form-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    padding: 12px;
  }

  /* Table responsive */
  .submissions-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .submissions-table th,
  .submissions-table td {
    padding: 10px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Notification list */
  .notification-list li {
    padding: 12px;
    font-size: 14px;
  }

  /* Reset password form */
  .reset-password-form {
    padding: 20px 15px;
    margin: 20px 10px;
  }
}

@media (max-width: 480px) {
  /* Mobile menu toggle positioning */
  .user-mobile-menu-toggle {
    top: 90px;
    left: 280px;
    padding: 10px;
  }

  /* Sidebar adjustments */
  .user-sidebar {
    width: 260px;
  }

  /* Main content */
  .user-main-content {
    padding: 15px 10px;
    padding-top: 20px;
    padding-bottom: 80px;
  }

  .user-content-body {
    padding: 15px 10px;
  }

  .user-notifications {
    padding: 15px 10px;
  }

  /* Headers */
  .user-content-header h1 {
    font-size: 1.25rem;
  }

  .user-content-body h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  /* Stats grid - single column on small mobile */
  .user-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .user-stat-card {
    padding: 20px;
  }

  .user-stat-card h3 {
    font-size: 12px;
  }

  .user-stat-card p {
    font-size: 24px;
  }

  /* Upload form */
  .upload-form-container {
    padding: 0;
  }

  .form-progress {
    margin-bottom: 25px;
  }

  .step-circle {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .step-label {
    font-size: 9px;
  }

  .upload-form input,
  .upload-form textarea {
    padding: 10px;
    font-size: 14px;
    margin-bottom: 15px;
  }

  .upload-form label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  /* Buttons */
  .btn {
    padding: 10px;
    font-size: 14px;
  }

  /* Table - full responsive */
  .submissions-table {
    font-size: 12px;
  }

  .submissions-table th,
  .submissions-table td {
    padding: 8px 5px;
    font-size: 11px;
  }

  /* Notifications */
  .notification-list li {
    padding: 10px;
    font-size: 13px;
  }

  .mark-read-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  /* Reset password */
  .reset-password-form {
    padding: 15px 10px;
    margin: 15px 5px;
  }

  .reset-password-form input,
  .reset-password-form .submit-btn {
    font-size: 14px;
    padding: 10px;
  }

  /* Flash messages */
  .flash-message {
    padding: 10px 15px;
    font-size: 13px;
  }
}
