/**
 * iParkandFly Shuttle Pickup Transfer - Styles
 * Branded with iParkandFly CI
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Blue */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Secondary Orange */
    --secondary-50: #fff7ed;
    --secondary-100: #ffedd5;
    --secondary-200: #fed7aa;
    --secondary-300: #fdba74;
    --secondary-400: #fb923c;
    --secondary-500: #f97316;
    --secondary-600: #ea580c;
    --secondary-700: #c2410c;
    --secondary-800: #9a3412;
    --secondary-900: #7c2d12;

    /* Neutral */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows */
    --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--neutral-50) 0%, var(--primary-50) 50%, var(--neutral-100) 100%);
    min-height: 100vh;
    color: var(--neutral-800);
    line-height: 1.6;
}

.container {
    max-width: 540px;
    margin: 0 auto;
}

/* Global Top-Left Logo */
.global-logo {
    position: fixed;
    top: 0;
    left: 1rem;
    z-index: 1000;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.global-logo:hover {
    opacity: 1;
}

.global-logo img {
    height: 48px;
    width: auto;
}

@media (max-width: 576px) {
    .global-logo {
        top: 0;
        left: 0.75rem;
    }

    .global-logo img {
        height: 36px;
    }
}

/* Header / Logo */
.app-header {
    text-align: center;
    padding: 1.5rem 0;
}

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

.app-header-with-switcher .header-spacer {
    flex: 0 0 80px;
}

.app-header-with-switcher .header-logo {
    flex: 1;
    text-align: center;
}

.app-header-with-switcher .language-switcher {
    flex: 0 0 80px;
    padding: 0;
    justify-content: flex-end;
}

.app-logo {
    height: 48px;
    width: auto;
}

.company-logo {
    max-height: 70px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.admin-company-logo {
    max-height: 50px;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.company-badge {
    display: inline-block;
    background: var(--primary-600);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

/* Language Selection Screen */
.language-selection-screen {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.language-picker-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-medium);
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--neutral-200);
}

.language-picker-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 1.5rem;
}

.language-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--neutral-50);
    border: 2px solid var(--neutral-200);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--neutral-800);
    transition: all 0.2s ease;
    font-weight: 500;
}

.language-btn:hover {
    background: white;
    border-color: var(--primary-500);
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.language-flag {
    font-size: 2rem;
    line-height: 1;
}

.language-name {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Language Switcher Dropdown */
.language-switcher {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0;
}

.lang-dropdown {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-700);
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.lang-dropdown-btn:hover {
    border-color: var(--neutral-300);
    background: var(--neutral-50);
}

.lang-dropdown-btn .lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-dropdown-btn .lang-code {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.lang-dropdown-btn .lang-chevron {
    font-size: 0.75rem;
    color: var(--neutral-400);
    transition: transform 0.2s;
}

.lang-dropdown.open .lang-dropdown-btn .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-medium);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: var(--neutral-700);
    font-size: 0.9375rem;
    transition: background 0.15s;
}

.lang-dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.lang-dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.lang-dropdown-item:hover {
    background: var(--neutral-50);
    color: var(--neutral-900);
}

.lang-dropdown-item .lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-dropdown-item .lang-name {
    flex: 1;
    font-weight: 500;
}

.lang-dropdown-item .lang-check {
    color: var(--primary-600);
    font-size: 1rem;
    opacity: 0;
}

.lang-dropdown-item.active .lang-check {
    opacity: 1;
}

.lang-dropdown-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0 0 0.25rem 0;
}

.page-header .subtitle {
    color: var(--neutral-500);
    font-size: 0.9375rem;
    margin: 0;
}

/* Form Styling */
#pickup-form {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-200);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--neutral-700);
    margin-bottom: 0.375rem;
}

.form-control {
    border: 1px solid var(--neutral-300);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.invalid-feedback {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-700);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background: var(--primary-400);
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--secondary-700);
}

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

.btn-outline:hover {
    background: var(--primary-50);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

#submit-btn {
    margin-top: 1rem;
    width: 100%;
}

/* Success Screen */
#success-container {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-200);
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#success-container h2 {
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

#success-container .lead {
    color: var(--neutral-700);
    font-size: 1.0625rem;
    margin: 0 0 0.5rem 0;
}

#success-container .text-muted {
    color: var(--neutral-500);
    font-size: 0.9375rem;
}

/* Marketing / Funnel Section */
.marketing-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--neutral-200);
}

.marketing-card {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
}

.marketing-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.marketing-card p {
    font-size: 0.9375rem;
    opacity: 0.9;
    margin: 0 0 1rem 0;
}

.marketing-card .btn {
    background: white;
    color: var(--primary-700);
    font-weight: 600;
}

.marketing-card .btn:hover {
    background: var(--neutral-100);
}

.marketing-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.marketing-feature {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Warning Modal */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-medium);
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 0.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--neutral-800);
}

.modal-body {
    padding: 0.5rem 1.5rem 1rem;
    font-size: 1rem;
    color: var(--neutral-600);
}

.modal-footer {
    border-top: none;
    padding: 0 1.5rem 1.5rem;
}

/* Admin Page */
.admin-body {
    background: linear-gradient(135deg, var(--neutral-900) 0%, var(--primary-900) 100%);
    color: white;
    min-height: 100vh;
}

.admin-logo {
    opacity: 0.9;
    transition: opacity 0.2s;
}

.admin-logo:hover {
    opacity: 1;
}

.admin-logo img {
    height: 48px;
    width: auto;
}

.admin-body .text-muted {
    color: var(--neutral-400) !important;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.admin-header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-operator-logo {
    text-align: center;
    padding: 1rem 0 2rem 0;
}

.admin-header .app-logo {
    height: 40px;
}

#pickup-count {
    background: var(--primary-600);
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}

#sound-toggle {
    background: transparent;
    border: 1px solid var(--neutral-600);
    color: var(--neutral-300);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#sound-toggle:hover {
    border-color: var(--neutral-500);
    color: white;
}

#sound-toggle.enabled {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Empty State */
#empty-state {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

#empty-state p {
    color: var(--neutral-400);
    font-size: 1.0625rem;
    margin: 0;
}

/* Pickup Cards */
.pickup-card {
    background: white;
    color: var(--neutral-800);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-soft);
    animation: slideIn 0.3s ease;
}

.pickup-card.new {
    animation: highlight 2s ease;
}

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

@keyframes highlight {
    0%, 100% { background: white; }
    20%, 60% { background: var(--secondary-100); }
}

.pickup-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.pickup-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--neutral-900);
}

.pickup-time {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    white-space: nowrap;
    background: var(--neutral-100);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.pickup-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pickup-detail {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pickup-detail-label {
    font-size: 0.75rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.pickup-detail-value {
    font-weight: 600;
    color: var(--neutral-700);
}

.pickup-plate {
    background: var(--neutral-100);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--neutral-800);
    border: 1px solid var(--neutral-200);
}

.pickup-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-complete {
    background: var(--success);
    border: none;
    color: white;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

.btn-complete:hover {
    background: #16a34a;
}

.btn-complete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Connection Status */
#connection-status {
    text-align: center;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--primary-600);
    color: white;
}

#connection-status.connected {
    display: none !important;
}

#connection-status.error {
    background: var(--error);
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .pickup-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pickup-time {
        align-self: flex-start;
    }

    .pickup-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-header-with-switcher {
        flex-wrap: wrap;
    }

    .app-header-with-switcher .header-spacer {
        display: none;
    }

    .app-header-with-switcher .header-logo {
        order: 1;
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }

    .app-header-with-switcher .language-switcher {
        order: 2;
        flex: 1 1 100%;
        justify-content: center;
    }

    #pickup-form {
        padding: 1.25rem;
    }

    .marketing-features {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-header {
        justify-content: center;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Screen Shake for New Pickup */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.screen-shake {
    animation: shake 0.5s ease;
}

/* Logout Button */
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--neutral-600);
    color: var(--neutral-400);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Session Expired Overlay */
#session-expired-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.session-expired-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.session-expired-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.session-expired-content h2 {
    color: var(--error);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.session-expired-content p {
    color: var(--neutral-300);
    font-size: 1.125rem;
    margin: 0 0 2rem 0;
}

.session-expired-content .btn {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* Landing Page */
.landing-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 0;
}

.landing-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-200);
}

.operator-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.operator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--neutral-800);
    transition: all 0.2s ease;
}

.operator-item:hover {
    background: white;
    border-color: var(--primary-500);
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.operator-logo {
    max-height: 40px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.operator-name-only {
    font-weight: 600;
    font-size: 1rem;
}

.operator-arrow {
    color: var(--neutral-400);
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.operator-item:hover .operator-arrow {
    color: var(--primary-600);
    transform: translateX(4px);
}

.landing-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--neutral-400);
    font-size: 0.875rem;
}

.landing-divider::before,
.landing-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-200);
}

.partner-cta {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
    border-color: var(--primary-200);
}

.partner-cta .btn {
    margin-top: 0.5rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--neutral-500);
    font-size: 0.8125rem;
}

.app-footer a {
    color: var(--primary-600);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}
