/* Aetna Hose, Hook and Ladder Company Custom Styles */

/* AHHL Color Palette */
:root {
    --ahhl-blue: #1f3a93;
    --ahhl-blue-light: #4a6cb8;
    --ahhl-blue-dark: #16296b;
    --ahhl-yellow: #ffd700;
    --ahhl-yellow-light: #fff44f;
    --ahhl-yellow-dark: #ccac00;
    --ahhl-red: #dc2626;
    --ahhl-success: #059669;
    --ahhl-warning: #d97706;
    --ahhl-info: #0891b2;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* AHHL Color Classes */
.text-ahhl-blue { color: var(--ahhl-blue) !important; }
.text-ahhl-blue-light { color: var(--ahhl-blue-light) !important; }
.text-ahhl-yellow { color: var(--ahhl-yellow) !important; }
.bg-ahhl-blue { background-color: var(--ahhl-blue) !important; }
.bg-ahhl-blue-light { background-color: var(--ahhl-blue-light) !important; }
.bg-ahhl-yellow { background-color: var(--ahhl-yellow) !important; }
.border-ahhl-blue { border-color: var(--ahhl-blue) !important; }

/* AHHL Button Styles */
.btn-ahhl-primary {
    background-color: var(--ahhl-blue);
    border-color: var(--ahhl-blue);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-ahhl-primary:hover,
.btn-ahhl-primary:focus {
    background-color: var(--ahhl-blue-dark);
    border-color: var(--ahhl-blue-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(31, 58, 147, 0.3);
}

.btn-ahhl-secondary {
    background-color: var(--ahhl-yellow);
    border-color: var(--ahhl-yellow);
    color: var(--ahhl-blue);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-ahhl-secondary:hover,
.btn-ahhl-secondary:focus {
    background-color: var(--ahhl-yellow-dark);
    border-color: var(--ahhl-yellow-dark);
    color: var(--ahhl-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.btn-outline-ahhl-blue {
    border-color: var(--ahhl-blue);
    color: var(--ahhl-blue);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-ahhl-blue:hover,
.btn-outline-ahhl-blue:focus {
    background-color: var(--ahhl-blue);
    border-color: var(--ahhl-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(31, 58, 147, 0.3);
}

/* Enhanced Button Styles for Mobile */
.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
    min-height: 48px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .btn-lg {
        font-size: 1.05rem;
        padding: 14px 20px;
        min-height: 52px;
    }
}

/* iOS Clipboard Compatibility */
.ios-clipboard-safe {
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
}

/* Prevent interference with text selection */
.ios-clipboard-safe:focus {
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
}

/* Mobile-specific input improvements */
@media (max-width: 768px) {
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    textarea {
        font-size: 16px !important; /* Prevents zoom */
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    /* Ensure copy/paste menus don't get dismissed */
    textarea.ios-clipboard-safe {
        resize: none; /* Disable resize during input */
        transition: none; /* Remove animations that interfere */
    }
    
    textarea.ios-clipboard-safe[data-focused="true"] {
        height: auto !important; /* Prevent height changes during interaction */
    }
    
    /* Specific fixes for login page inputs */
    .login-form input {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -khtml-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
        border-radius: 8px !important;
        transition: none !important; /* Remove all transitions */
        -webkit-appearance: none !important;
        background-color: white !important;
    }
    
    .login-form input:focus {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        outline: 2px solid #007bff !important;
        border-color: #007bff !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    /* Prevent any potential interference from Bootstrap or other CSS */
    .login-form * {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        user-select: text !important;
    }
    
    .login-form input,
    .login-form input:focus,
    .login-form input:active {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
    
    /* Apply same fixes to change password page */
    .change-password-form input {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -khtml-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
        border-radius: 8px !important;
        transition: none !important;
        -webkit-appearance: none !important;
        background-color: white !important;
    }
    
    .change-password-form input:focus {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        outline: 2px solid #007bff !important;
        border-color: #007bff !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .change-password-form * {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        user-select: text !important;
    }
    
    .change-password-form input,
    .change-password-form input:focus,
    .change-password-form input:active {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
    
    /* Apply same fixes to forgot password page */
    .forgot-password-form input {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -khtml-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 48px !important;
        border-radius: 8px !important;
        transition: none !important;
        -webkit-appearance: none !important;
        background-color: white !important;
    }
    
    .forgot-password-form input:focus {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        outline: 2px solid #007bff !important;
        border-color: #007bff !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .forgot-password-form * {
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        user-select: text !important;
    }
    
    .forgot-password-form input,
    .forgot-password-form input:focus,
    .forgot-password-form input:active {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: default !important;
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
}
}

/* Navigation Styles */
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Card Enhancements */
.card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card.shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Welcome Card */
.ahhl-welcome-card {
    background: linear-gradient(135deg, var(--ahhl-blue) 0%, var(--ahhl-blue-light) 100%);
    color: white;
}

.ahhl-logo-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ahhl-logo-icon {
    font-size: 2.5rem;
    color: var(--ahhl-yellow);
}

.ahhl-motto {
    background: rgba(255, 215, 0, 0.1);
    padding: 12px 24px;
    border-radius: 25px;
    display: inline-block;
}

/* Quick Action Cards */
.quick-action-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.quick-action-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--ahhl-blue) 0%, var(--ahhl-blue-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon i {
    font-size: 1.8rem;
    color: white;
}

/* Statistics Cards */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Admin Panel Styles */
.admin-action-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.admin-action-card:hover {
    border-color: var(--ahhl-blue);
    background-color: #f8f9ff;
    transform: translateY(-2px);
}

.admin-action-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-action-icon i {
    font-size: 1.5rem;
}

/* Vehicle Selection Cards */
.vehicle-select-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.vehicle-select-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--ahhl-blue);
}

.vehicle-icon {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
}

.vehicle-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}

/* Check Form Styles */
.check-item {
    transition: all 0.3s ease;
    position: relative;
}

.check-item.ok {
    background-color: #f0f9f0;
    border-left: 4px solid var(--ahhl-success);
}

.check-item.deficient {
    background-color: #fef7f0;
    border-left: 4px solid var(--ahhl-red);
}

.status-buttons .btn {
    min-width: 100px;
    font-weight: 600;
}

.status-buttons .btn-check:checked + .btn {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.deficiency-details {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Category Accordion */
.category-card .card-header button {
    text-decoration: none !important;
}

.category-progress {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Progress Bar */
.check-progress .progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.5s ease;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--ahhl-blue);
    box-shadow: 0 0 0 0.2rem rgba(31, 58, 147, 0.25);
}

.form-control-lg {
    border-radius: 8px;
    min-height: 48px;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

/* History Page Styles */
.check-row {
    transition: all 0.3s ease;
}

.check-row:hover {
    background-color: #f8f9fa;
}

.table-hover-effect {
    background-color: #e3f2fd !important;
}

.check-details {
    border-top: 2px solid var(--ahhl-blue);
}

.check-item-detail {
    font-size: 0.85rem;
}

.bg-success-light {
    background-color: #f0f9f0 !important;
}

.bg-danger-light {
    background-color: #fef7f0 !important;
}

/* Footer Styles */
footer {
    margin-top: auto;
}

/* Info Stats */
.info-stat {
    padding: 15px;
}

.info-stat i {
    font-size: 1.5rem;
    display: block;
}

/* Fleet Info */
.fleet-info {
    padding: 15px 10px;
}

.fleet-info i {
    font-size: 1.5rem;
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        border-radius: 8px;
    }
    
    .vehicle-select-card .card-body {
        padding: 2rem 1.5rem;
    }
    
    .check-item {
        padding: 1.5rem !important;
    }
    
    .status-buttons {
        margin-top: 1rem;
    }
    
    .status-buttons .btn {
        min-width: 80px;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
}

/* Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:active {
        transform: scale(0.98);
    }
    
    .vehicle-select-card:active {
        transform: scale(0.98);
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Login Page Styles */
.login-header-icon {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 50%;
    display: inline-block;
}

/* Badge Styles */
.badge {
    font-size: 0.7em;
    font-weight: 600;
}

.bg-ahhl-blue-light {
    background-color: var(--ahhl-blue-light) !important;
    color: white !important;
}

/* Accordion Customizations */
.accordion-button:not(.collapsed) {
    background-color: var(--ahhl-blue);
    color: white;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(31, 58, 147, 0.25);
}

/* Success Page Styles */
.success-icon {
    background: #ecfdf5;
    padding: 30px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 20px;
}

.result-stat {
    padding: 20px;
    text-align: center;
}

.result-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}

.result-stat .stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .text-ahhl-blue {
        color: #000 !important;
    }
}
