/* Lehigh University Ski Club PWA - Custom Styles */

/* Lehigh University Color Palette - Correct Colors from Design Guidelines */
:root {
    /* Website Accent Colors */
    --lehigh-gold: #ffe41e;
    --lehigh-beige: #fffbe1;
    --lehigh-teal: #80c7bc;
    --lehigh-blue: #8ac3ea;
    --lehigh-brown: #502d0e;
    --lehigh-dark-blue: #2b5870;
    
    /* UCPA Approved Colors */
    --lehigh-brown-02: #f6f4f2;
    --lehigh-brown-20: #dec8b2;
    --lehigh-brown-60: #9f7549;
    --lehigh-brown-80: #83541e;
    --lehigh-gold-20: #fffbe1;
    --lehigh-gold-60: #fdeca1;
    --lehigh-gold-80: #fde780;
    --lehigh-gold-k20: #d5bf4d;
    --lehigh-red: #ef483e;
    --lehigh-red-20: #ffded5;
    --lehigh-red-60: #fa9d88;
    --lehigh-red-95: #e8564d;
    --lehigh-red-k20: #c53c33;
    --lehigh-coral: #f69576;
    --lehigh-dark-red: #ac1d15;
    --lehigh-teal-full: #88c6bc;
    --lehigh-teal-20: #e8f3f0;
    --lehigh-teal-60: #80c7bc;
    --lehigh-teal-k20: #6ba69e;
    --lehigh-teal-k60: #3d6762;
    --lehigh-dark-teal: #0e524e;
    --lehigh-blue-full: #81b0d2;
    --lehigh-blue-20: #dee9f4;
    --lehigh-blue-75: #8ac3ea;
    --lehigh-blue-k20: #5394b8;
    --lehigh-blue-k60: #2b5870;
    --lehigh-grey: #d0cac2;
    --lehigh-grey-20: #f4f3f2;
    --lehigh-grey-60: #e1dfda;
    --lehigh-grey-k20: #ada8a2;
    --lehigh-grey-k60: #6a6764;
    
    /* Base Colors */
    --lehigh-white: #ffffff;
    --lehigh-off-white: #f1f1f1;
    --lehigh-black: #000000;
    --lehigh-grey-darkest: #333333;
    --lehigh-grey-light: #e1e1e1;
    --lehigh-grey-lightest: #f8f8f8;
    --lehigh-base-font: #212529;
    --lehigh-drop-shadow: #F0F0F0;
    --lehigh-hyperlink: #327D9A;
    --lehigh-hyperlink-breadcrumb: #335671;
    --lehigh-maroon: #722723;
    --lehigh-maroon-light: #742e2a;
}

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Lehigh Card Styling - Based on Design Guidelines */
.card {
    width: 100%;
    background-color: var(--lehigh-white);
    border-left: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 5px;
    border-top: 3px solid var(--lehigh-brown);
    box-shadow: 0 5px 15px var(--lehigh-drop-shadow);
    transition: all 0.2s ease;
}

.card:hover,
.card:focus-within {
    box-shadow: 0 0 10px var(--lehigh-drop-shadow);
}

.card-body {
    display: flex;
    flex-direction: column;
}

.card-title {
    color: var(--lehigh-base-font);
}

.card-title a {
    color: inherit;
    text-decoration: underline;
    border-bottom: 0;
}

.card-title a:hover,
.card-title a:focus {
    text-decoration: none;
    border-bottom: 0;
}

.card-text a {
    color: var(--lehigh-hyperlink-breadcrumb);
    border-bottom: 2px solid var(--lehigh-hyperlink-breadcrumb);
}

.card-text a:hover,
.card-text a:focus {
    color: var(--lehigh-black) !important;
    border-bottom: var(--lehigh-brown) !important;
}

/* Trip card animations */
.trip-card {
    transform: translateY(0);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Lehigh University Button Styles - Brown/Gold Focus */
.btn-primary {
    background: var(--lehigh-blue-75);
    color: var(--lehigh-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #b6d3e9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 181, 202, 0.336)
}

/* Lehigh Button Variants - Gold for Actions, Blue for Cancel, Red-k20 for Delete */
.btn-yellow {
    background: var(--lehigh-gold);
    color: var(--lehigh-black);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-yellow:hover {
    background: var(--lehigh-gold-60);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 228, 30, 0.4);
}

/* Less saturated gold for edit actions */
.btn-gold-subtle {
    background: var(--lehigh-gold);
    color: var(--lehigh-black);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gold-subtle:hover {
    background: var(--lehigh-gold-60);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 236, 161, 0.4);
}

/* Red-k20 for delete actions only */
.btn-red {
    background: var(--lehigh-grey-darkest);
    color: var(--lehigh-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-red:hover {
    background: #595959;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(89, 89, 89, 0.4);
}

/* Blue for cancel actions */
.btn-blue {
    background: var(--lehigh-blue);
    color: var(--lehigh-black);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-blue:hover {
    background: var(--lehigh-blue-k20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138, 195, 234, 0.4);
}

/* Legacy button names for compatibility */
.btn-maroon {
    background: var(--lehigh-red-k20);
    color: var(--lehigh-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-maroon:hover {
    background: var(--lehigh-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 60, 51, 0.4);
}

.btn-green {
    background: var(--lehigh-gold);
    color: var(--lehigh-black);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-green:hover {
    background: var(--lehigh-gold-k20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 228, 30, 0.4);
}

/* Lehigh Form Styles */
.form-input:focus {
    border-color: var(--lehigh-brown);
    box-shadow: 0 0 0 3px rgba(80, 45, 14, 0.1);
}

/* Lehigh Alert Styles - Correct Colors */
.alert-default {
    background: var(--lehigh-grey-lightest);
    color: var(--lehigh-base-font);
    border: 1px solid var(--lehigh-grey-light);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-secondary {
    background: var(--lehigh-grey-20);
    color: var(--lehigh-base-font);
    border: 1px solid var(--lehigh-grey-k20);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-success {
    background: var(--lehigh-brown-02);
    color: var(--lehigh-brown);
    border: 1px solid var(--lehigh-brown-20);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-danger {
    background: var(--lehigh-red-20);
    color: var(--lehigh-red-k20);
    border: 1px solid var(--lehigh-red-k20);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-warning {
    background: var(--lehigh-gold-20);
    color: var(--lehigh-gold-k20);
    border: 1px solid var(--lehigh-gold);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-info {
    background: var(--lehigh-blue-20);
    color: var(--lehigh-blue-k60);
    border: 1px solid var(--lehigh-blue);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-light {
    background: var(--lehigh-white);
    color: var(--lehigh-base-font);
    border: 1px solid var(--lehigh-grey-light);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-dark {
    background: var(--lehigh-grey-darkest);
    color: var(--lehigh-white);
    border: 1px solid var(--lehigh-black);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Lehigh Toast Notifications - Correct Colors */
.toast {
    animation: slideIn 0.3s ease-out;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.toast.success {
    border-left: 4px solid var(--lehigh-brown);
    background: var(--lehigh-brown-02);
    color: var(--lehigh-brown);
}

.toast.error {
    border-left: 4px solid var(--lehigh-red-k20);
    background: var(--lehigh-red-20);
    color: var(--lehigh-red-k20);
}

.toast.info {
    border-left: 4px solid var(--lehigh-blue);
    background: var(--lehigh-blue-20);
    color: var(--lehigh-blue-k60);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Profile setup form validation */
.profile-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.profile-input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Profile setup form animations */
.profile-setup-form {
    animation: slideUp 0.4s ease-out;
}

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

/* Phone input formatting - removed monospace font to match other fields */
#profilePhone {
    font-family: inherit;
}

/* Profile form button layout */
#profileSetupForm .flex.space-x-3 {
    gap: 0.75rem;
}

#profileSetupForm .flex-1 {
    flex: 1 1 0%;
}

/* Lehigh Admin badge styling - Brown Focus */
.admin-badge {
    background: linear-gradient(135deg, var(--lehigh-brown) 0%, var(--lehigh-brown-80) 100%);
    color: var(--lehigh-white);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(80, 45, 14, 0.3);
}

/* Sign-up modal styling */
#signUpModal {
    backdrop-filter: blur(4px);
}

/* Ensure modal container is properly sized */
#signUpModal > div {
    max-height: 90vh !important;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Ensure content area is scrollable */
#signUpModal .overflow-y-auto {
    overflow-y: auto !important;
    max-height: none;
    flex: 1;
    min-height: 0;
}

/* Force scrollbar to always show when needed */
#signUpModal .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Additional modal constraints for better scrolling */
#signUpModal {
    overflow: hidden;
}

#signUpModal > div {
    overflow: hidden;
}

/* Force modal to be properly sized and scrollable */
#signUpModal .max-h-\[90vh\] {
    max-height: 90vh !important;
    height: auto;
}

#signUpModal .overflow-y-auto {
    overflow-y: auto !important;
    max-height: none;
    min-height: 0;
}

/* Ensure form doesn't cause overflow */
#signUpModal form {
    max-width: 100%;
}

/* Mobile-specific modal adjustments */
@media (max-width: 640px) {
    #signUpModal {
        padding: 0.5rem;
    }
    
    #signUpModal > div {
        max-height: 95vh;
        margin: 0;
    }
    
    #signUpModal .p-6 {
        padding: 1rem;
    }
}

/* Responsive design improvements */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .trip-card {
        margin-bottom: 1rem;
    }
}

/* Lehigh PWA-specific styles - Brown Focus */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--lehigh-brown);
    color: var(--lehigh-white);
    padding: 1rem;
    text-align: center;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.install-prompt.show {
    transform: translateY(0);
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    text-align: center;
    padding: 0.5rem;
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* Trip status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-open {
    background: #dcfce7;
    color: #166534;
}

.status-full {
    background: #fef3c7;
    color: #92400e;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* User role indicators */
.role-driver {
    background: #dbeafe;
    color: #1e40af;
}

.role-passenger {
    background: var(--lehigh-blue-20);
    color: blue;
}

/* Lehigh Admin delete button styling - Lighter Red */
.admin-delete-btn {
    background: var(--lehigh-red-k20);
    color: var(--lehigh-white);
    transition: all 0.2s ease;
}

.admin-delete-btn:hover {
    background: var(--lehigh-red);
    transform: scale(1.05);
}

/* Modal scrollbar styling */
#signUpModal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#signUpModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#signUpModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#signUpModal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive grid for trips */
.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .trips-grid {
        grid-template-columns: 1fr;
    }
}

/* Lehigh Trip Section Styling - Brown Focus */
#signedUpTripsSection {
    border: 2px solid var(--lehigh-brown);
    background: var(--lehigh-brown-02);
    border-radius: 0.5rem;
}

#signedUpTripsSection h2 {
    color: var(--lehigh-brown);
    font-weight: 600;
}

/* Signed up trip card styling */
#signedUpTripsList .trip-card {
    border-left-color: var(--lehigh-brown);
    background: var(--lehigh-brown-02);
    border-radius: 0.5rem;
}

#signedUpTripsList .trip-card:hover {
    background: var(--lehigh-white);
    border-left-color: var(--lehigh-brown-60);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(80, 45, 14, 0.1);
}

/* Available trips section styling */
#availableTripsSection {
    border: 2px solid var(--lehigh-brown-60);
    background: linear-gradient(135deg, var(--lehigh-brown-02) 0%, var(--lehigh-white) 100%);
    border-radius: 0.5rem;
}

#availableTripsSection h2 {
    color: var(--lehigh-brown-60);
    font-weight: 600;
}

/* Available trip card styling */
#availableTripsList .trip-card {
    border-left-color: var(--lehigh-brown-60);
    background: var(--lehigh-white);
    border-radius: 0.5rem;
}

#availableTripsList .trip-card:hover {
    background: var(--lehigh-brown-02);
    border-left-color: var(--lehigh-brown);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(159, 117, 73, 0.1);
}

/* Form validation styling */
.text-red-500 {
    color: #ef4444;
}

/* Radio button styling */
input[type="radio"]:checked {
    border-color: #3b82f6;
    background-color: #3b82f6;
}

input[type="radio"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Required field indicator */
.required-field {
    color: #ef4444;
    font-weight: 600;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* iOS Safe Area Insets - Keep content below Dynamic Island/notch */
@supports (padding: max(0px)) {
    /* Body should account for safe areas on sides and bottom */
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Header should respect safe area at top (Dynamic Island/notch) */
    header {
        padding-top: env(safe-area-inset-top, 0.25rem);
        padding-bottom: 1rem;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Header container padding adjustment - minimal height */
    header .container {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    /* Reduce button sizes on mobile for compact header */
    @media (max-width: 768px) {
        header button {
            padding: 0.375rem 0.5rem;
            font-size: 0.875rem;
        }
        
        header .w-8 {
            width: 2rem;
            height: 2rem;
        }
    }
    
    /* Main content should respect safe areas */
    main {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    /* Ensure modals respect safe areas */
    .fixed.inset-0 {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Toast notifications should respect safe area */
    #toastContainer {
        top: calc(1rem + env(safe-area-inset-top));
        right: calc(1rem + env(safe-area-inset-right));
    }
}

/* Responsive trip card layouts for mobile */
@media (max-width: 768px) {
    /* Trip card button container - stack buttons vertically */
    .trip-card .flex.justify-between.items-center {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    /* Badges container - separate from buttons */
    .trip-card .flex.items-center.space-x-2 {
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
    }
    
    /* Buttons container - stack vertically on mobile */
    .trip-card .flex.space-x-2 {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    /* Make buttons full width on mobile */
    .trip-card .flex.space-x-2 button,
    .trip-card .flex.space-x-2 span {
        width: 100%;
        justify-content: center;
    }
    
    /* Trip form - stack all fields on mobile */
    #tripForm {
        grid-template-columns: 1fr !important;
    }
    
    /* Driver trip fields - stack on mobile */
    #driverTripFields {
        grid-column: 1 !important;
    }
    
    /* Ensure trip cards don't overflow */
    .trip-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Grid columns for departure/return - stack on very small screens */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Container max width */
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

