/* Mobile-First Drive Tracker Styles - iOS Inspired */

:root {
    --primary-color: #007AFF;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --secondary-color: #8E8E93;
    --background-color: #F2F2F7;
    --card-background: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #C6C6C8;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    line-height: 1.4;
    color: var(--text-primary);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

.container-fluid {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 16px 16px; /* Normal bottom padding */
    background-color: var(--background-color);
}

/* Header */
.app-header {
    padding: 20px 0 10px;
    background-color: var(--background-color);
}

.app-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex-shrink: 0;
}

.user-info {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive header adjustments */
@media (max-width: 480px) {
    .app-title {
        font-size: 24px;
    }

    .user-info {
        font-size: 12px;
    }
}

/* Home page welcome styles */
.app-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    font-weight: 400;
}

.welcome-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Dashboard statistics */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 12px 0;
}

.dashboard-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dashboard-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 4px 0;
}

.dashboard-stat-card .stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Timer Display */
.timer-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 30px 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.timer-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 64px;
    font-weight: 500;
    line-height: 1;
    margin: 10px 0 30px;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.timer-display.active {
    color: var(--success-color);
}

.timer-display.paused {
    color: var(--warning-color);
}

/* Spinning asterisks */
.spinner-asterisk {
    display: inline-block;
    animation: spin 0.5s linear infinite;
    transform-origin: 50% 50%;
    line-height: 1;
    vertical-align: middle;
    font-size: 0.6em;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Paused Indicator */
.paused-indicator {
    font-size: 14px;
    font-weight: 600;
    color: var(--warning-color);
    background-color: rgba(255, 149, 0, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: blink 1.5s infinite;
    white-space: nowrap;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

/* Button Container */
.timer-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* iOS-style Buttons */
.btn-ios {
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 32px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-ios:active {
    transform: scale(0.96);
}

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

.btn-success:hover {
    background-color: #28A745;
}

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

.btn-danger:hover {
    background-color: #DC2626;
}

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

.btn-primary:hover {
    background-color: #0056B3;
}

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

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

/* Form Card - moved to drive-rec.css */

/* Skills & Conditions Grid */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: var(--success-color);
}

.checkbox-item label {
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

/* Night Time Input - moved to drive-rec.css */

/* Notes Input - moved to drive-rec.css */

/* DateTime Inputs - moved to drive-rec.css */

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.btn-full {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-full:active {
    transform: scale(0.98);
}

/* Navigation Links */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 12px 0 16px 0;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

/* Error Messages */
.error-message {
    background-color: #FFEBEE;
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 500;
    border-left: 4px solid var(--danger-color);
}

/* Success Messages */
.success-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 30px 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 16px;
}

.success-details {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.success-note {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (min-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .timer-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: row;
    }
    
    .btn-full {
        flex: 1;
    }
}

@media (min-width: 768px) {
    .container-fluid {
        max-width: 500px;
        padding: 0 20px;
    }
    
    .timer-display {
        font-size: 72px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* iOS-style Toggle Switches */
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 31px;
}

.ios-toggle .slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ios-toggle input:checked + .slider {
    background-color: var(--success-color);
}

.ios-toggle input:checked + .slider:before {
    transform: translateX(20px);
}

/* Learner Statistics Table */
.learner-stats-table, .driver-stats-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.learner-stats-card, .driver-stats-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.learner-name, .driver-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.learner-stats-grid, .driver-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: var(--background-color);
    border-radius: 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive adjustments for learner stats */
@media (min-width: 480px) {
    .learner-stats-grid, .driver-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .learner-name, .driver-name {
        text-align: left;
    }
}

@media (min-width: 768px) {
    .learner-stats-card, .driver-stats-card {
        padding: 20px;
    }
    
    .learner-name, .driver-name {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 13px;
    }
}

/* Override Bootstrap if needed */
.form-control {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--text-primary);
    background-color: var(--card-background);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

/* Drive History Styles */
.drives-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.drives-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Scrollable Drive History Container */
.drive-history-container {
    height: 60vh; /* 60% of viewport height - good for mobile */
    max-height: 600px; /* Maximum height on larger screens */
    min-height: 300px; /* Minimum height to ensure usability */
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--card-background);
    box-shadow: var(--shadow);
}

.drive-history-table {
    overflow: visible; /* Remove the previous overflow-x: auto */
    margin-top: 0; /* Reset margin since container handles spacing */
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    border-radius: 0; /* Remove border radius since container handles it */
    overflow: hidden;
    box-shadow: none; /* Remove shadow since container handles it */
    border: none; /* Remove border since container handles it */
}

.history-table thead {
    background-color: var(--background-color);
}

.history-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--background-color);
    z-index: 1;
}

.history-table td {
    padding: 12px;
    color: var(--text-primary);
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.history-table tbody tr:hover {
    background-color: var(--background-color);
}

.in-progress {
    color: var(--warning-color);
    font-weight: 600;
    font-style: italic;
}

/* Responsive adjustments for drive history table */
@media (max-width: 768px) {
    .drive-history-container {
        height: 50vh; /* Slightly smaller on tablets */
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .drive-history-container {
        height: 45vh; /* Optimized for mobile phones */
        min-height: 250px;
        max-height: 400px; /* Prevent it from being too tall on small phones */
    }

    .history-table th,
    .history-table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .history-table th {
        font-size: 12px;
        padding: 12px 8px; /* Slightly more padding for sticky header */
    }
}

/* Smooth scrolling for the drive history */
.drive-history-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}

/* Subtle scrollbar styling for webkit browsers */
.drive-history-container::-webkit-scrollbar {
    width: 6px;
}

.drive-history-container::-webkit-scrollbar-track {
    background-color: var(--background-color);
    border-radius: 3px;
}

.drive-history-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.drive-history-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Drive Edit Page Styles */
.drive-info-card {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.drive-info-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
}

.drive-info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drive-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.drive-info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

/* Total minutes row - moved to drive-rec.css */

.success-message {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
    font-weight: 500;
    text-align: center;
}

/* Make drive history rows clearly clickable */
.drive-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.drive-row:hover {
    background-color: rgba(0, 122, 255, 0.05) !important;
}

/* Responsive adjustments for drive edit */
@media (max-width: 480px) {
    .drive-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .total-minutes-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .total-minutes-row label {
        min-width: auto;
    }
    
    .total-input {
        max-width: 100%;
        width: 100%;
    }
}

/* Driver Management Styles */
.drivers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.driver-card {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.driver-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.driver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.driver-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.driver-actions {
    display: flex;
    gap: 8px;
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-edit:hover {
    background-color: #0056d6;
    color: white;
    text-decoration: none;
}

.driver-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.stat-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.inline-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.inline-link:hover {
    text-decoration: underline;
}

/* Driver Edit Form Styles */
.driver-name-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 24px 0;
}

.driver-name-row label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.driver-name-input {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 500;
    background-color: var(--card-background);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.driver-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.driver-name-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Navigation link styling for Add New Driver button */
.nav-link.btn-primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    transition: background-color 0.2s ease;
}

.nav-link.btn-primary:hover {
    background-color: #0056d6;
    color: white;
    text-decoration: none;
}

/* Responsive adjustments for driver management */
@media (max-width: 480px) {
    .driver-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .driver-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .driver-name-row {
        gap: 12px;
    }
}

    /* Top banner with app title and username */
    .app-banner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1rem 0;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 1rem;
    }
    
    .app-brand {
      font-size: 1.5rem;
      font-weight: 600;
      color: var(--text-primary);
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    
    .learner-select {
      color: var(--text-secondary);
      font-size: 0.9rem;
      font-weight: 500;
    }
    
    /* Bottom navigation with just links */
    .mobile-nav {
      background-color: var(--text-primary);
      color: white;
      padding: 1px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 12px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      margin-top: 8px;
      margin-bottom: 16px;
    }
    
    .nav-links {
      display: flex;
      gap: 1.5rem;
      align-items: center;
    }
    
    .nav-links a {
      color: white;
      text-decoration: none;
      padding: 8px 12px;
      border-radius: 8px;
      font-weight: 500;
      font-size: 14px;
      transition: background-color 0.2s ease;
    }
    
    .nav-links a:hover {
      background-color: rgba(255, 255, 255, 0.15);
    }

    .nav-links a.settings-icon {
      font-size: 36px !important;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 !important;
    }

    @media (max-width: 768px) {
      .app-brand {
        font-size: 1.3rem;
      }
      
      .mobile-nav {
        padding: 1px;
        margin-top: 8px;
        margin-bottom: 8px;
      }
      
      .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
      }
      
      .nav-links a {
        padding: 6px 10px;
        font-size: 13px;
      }

      .nav-links a.settings-icon {
        font-size: 30px !important;
        padding: 0 !important;
      }
    }

    /* Form styles for driver selector */
    .form-card {
      background: white;
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 1rem;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .form-section {
      margin-bottom: 1rem;
    }
    
    .form-label {
      display: block;
      margin-bottom: 0.5rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .form-control {
      width: 100%;
      padding: 0.75rem;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      font-size: 1rem;
      transition: border-color 0.2s ease;
    }
    
    .form-control:focus {
      outline: none;
      border-color: var(--accent-color);
    }

/* Drivers Table Styles */
.drivers-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.learners-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
}

.drivers-table th,
.drivers-table td {
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.learners-table th,
.learners-table td {
    padding: 12px 8px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

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

.drivers-table th,
.learners-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.drivers-table td,
.learners-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.drivers-table .driver-name,
.learners-table .learner-name {
    font-size: 13px;
    font-weight: 500;
}

.drivers-table tr:nth-child(even) {
    background-color: var(--background-color);
}

.drivers-table tr:hover,
.learners-table tr:hover {
    background-color: rgba(0, 122, 255, 0.05);
}

.drivers-table .text-center,
.learners-table .text-center {
    text-align: center;
}

.table-responsive,
.learners-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
}

/* Action buttons styling for tables */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid transparent;
    display: inline-block;
    text-align: center;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-outline-info {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-info:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.stat-badge {
    background-color: var(--background-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.date-badge {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

/* Responsive table adjustments */
@media (max-width: 480px) {
    .drivers-table th,
    .drivers-table td,
    .learners-table th,
    .learners-table td {
        padding: 10px 6px;
        font-size: 13px;
    }
    
    .drivers-table th,
    .learners-table th {
        font-size: 12px;
    }
    
    .drivers-table .driver-name,
    .learners-table .learner-name {
        font-size: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-sm {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Modal Fixes */
.modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal.fade:not(.show) {
    display: none !important;
}

.modal-dialog {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text-primary);
}

.btn-close::before {
    content: "×";
    font-weight: bold;
}

/* Bootstrap button overrides for modal */
.modal-footer .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-footer .btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #6c757d;
    color: white;
}

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

.modal-footer .btn-primary:hover {
    background-color: #0056d6;
    color: white;
}

/* Match container-fluid responsive behavior */
@media (min-width: 768px) {
    .modal-dialog {
        max-width: 500px;
    }
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: calc(100% - 32px);
        margin: 16px;
    }
    
    .modal-body {
        max-height: 50vh;
        padding: 16px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Drive Edit Page Styling - moved to drive-rec.css */

/* Compact Form Layout - moved to drive-rec.css */

/* Divider for login page */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--card-background);
    padding: 0 16px;
}

/* Form group styling for login */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Learner Cards Layout */
.learners-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.learner-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.learner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.learner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.learner-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.last-drive-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-badge {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    background-color: var(--background-color);
    padding: 4px 8px;
    border-radius: 6px;
}

.learner-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.learner-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 16px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
    border: 2px solid transparent;
    min-width: 100px;
}

/* Large action buttons - same size as toggle buttons */
.action-btn-lg {
    padding: 14px 12px;
    font-size: 15px;
    border-radius: 12px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

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

.action-btn.btn-primary:hover {
    background-color: #0056d6;
    color: white;
    text-decoration: none;
}

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

.action-btn.btn-secondary:hover {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
}

.action-btn.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.action-btn.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.action-btn.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.action-btn.btn-danger:hover {
    background-color: #c82333;
    color: white;
    text-decoration: none;
}

.action-btn:active {
    transform: scale(0.98);
}

/* Responsive adjustments for learner cards */
@media (max-width: 768px) {
    .learner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .learner-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-btn {
        font-size: 13px;
        padding: 8px 12px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .learner-card {
        padding: 16px;
    }

    .learner-name {
        font-size: 18px;
    }

    .date-badge {
        font-size: 12px;
    }

    .learner-stats-grid {
        gap: 8px;
    }

    .stat-item {
        padding: 6px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 11px;
    }

    .action-btn {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 70px;
    }
}

/* Form Actions - moved to drive-rec.css */

/* Drive View Page Styles - moved to drive-rec.css */

/* Toggle Buttons Panel - moved to drive-rec.css */

/* Clickable Drive Rows */
.drive-row.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.drive-row.clickable:hover {
    background-color: var(--background-color) !important;
}

.drive-row.clickable:active {
    background-color: #E5E5EA !important;
}

/* Clickable Learner Rows */
.learner-row.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.learner-row.clickable:hover {
    background-color: var(--background-color) !important;
}

.learner-row.clickable:active {
    background-color: #E5E5EA !important;
}

.learner-row.clickable .learner-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 16px 12px;
}

/* Chevron Column */
.row-chevron {
    text-align: right;
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 500;
    width: 30px;
    padding-right: 16px !important;
}

.drive-row.clickable:hover .row-chevron,
.learner-row.clickable:hover .row-chevron {
    color: var(--primary-color);
}

/* Page Title Row with Button */
.page-title-row {
    display: grid;
    /* Col 1 (button) = width of content, Col 2 (header) = all free space, Col 3 (button) = width of content */
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    text-align: center; /* This centers the h2 in its '1fr' column */
    gap: 16px;
    margin-bottom: 20px;
}

/* This ensures the button in the first column is explicitly left-aligned */
.page-title-row button:first-child {
    justify-self: start;
}

/* This ensures the button in the last column is explicitly right-aligned */
.page-title-row button:last-child {
    justify-self: end;
}

.page-title-row .page-title {
    margin: 0;
}

/* Round Edit Button */
.round-edit-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.round-edit-btn:hover {
    background-color: #005cbf;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.round-edit-btn:active {
    transform: scale(0.95);
}

.round-edit-btn svg {
    transition: all 0.15s ease;
}

/* Round Delete Button */
.round-delete-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: rgba(234, 8, 8, 0.925);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.round-delete-btn:hover {
    background-color: #bf1600;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.round-delete-btn:active {
    transform: scale(0.95);
}

.round-delete-btn svg {
    transition: all 0.15s ease;
}
