/**
 * CATS Fare Calculator Styles
 * Mobile-first, accessible design
 * Brand colors: Navy (#1a2e44) + Gold (#c9a55c)
 */

/* ====================
   Base Container
   ==================== */
.cats-fare-calculator {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cats-fare-form {
    background: #ffffff;
    border: 2px solid #1a2e44;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(26, 46, 68, 0.1);
}

.cats-fare-form h2 {
    color: #1a2e44;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.cats-fare-subtitle {
    color: #555;
    font-size: 18px;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

/* ====================
   Form Fields
   ==================== */
.cats-form-field {
    margin-bottom: 1.5rem;
}

.cats-form-field label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1a2e44;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cats-form-field input[type="text"],
.cats-form-field input[type="date"],
.cats-form-field select {
    width: 100%;
    min-height: 52px; /* Large tap target */
    padding: 0.75rem 1rem;
    font-size: 18px; /* Large text for accessibility */
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cats-form-field input[type="text"]:focus,
.cats-form-field input[type="date"]:focus,
.cats-form-field select:focus {
    outline: none;
    border-color: #c9a55c; /* Gold focus */
    box-shadow: 0 0 0 3px rgba(201, 165, 92, 0.2);
}

.cats-form-field input[type="text"]:hover,
.cats-form-field input[type="date"]:hover,
.cats-form-field select:hover {
    border-color: #999;
}

/* Error state */
.cats-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1) !important;
}

/* Google autocomplete dropdown styling */
.pac-container {
    font-size: 18px;
    border-radius: 8px;
    border: 2px solid #1a2e44;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.pac-item {
    padding: 12px 16px;
    line-height: 1.5;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #f5f5f5;
}

/* ====================
   Checkboxes (Extras)
   ==================== */
.cats-extras label {
    font-size: 18px;
}

.cats-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cats-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 52px; /* Large tap target */
}

.cats-checkbox:hover {
    border-color: #c9a55c;
    background-color: #fafafa;
}

.cats-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin: 0 12px 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.cats-checkbox span {
    font-size: 18px;
    color: #333;
    line-height: 1.4;
}

.cats-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #c9a55c;
    outline-offset: 2px;
}

/* ====================
   Buttons
   ==================== */
.cats-submit-btn,
.cats-book-btn,
.cats-holiday-call-btn {
    width: 100%;
    min-height: 56px; /* Large tap target */
    padding: 1rem 2rem;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #1a2e44 0%, #2a4564 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(26, 46, 68, 0.3);
}

.cats-submit-btn:hover,
.cats-book-btn:hover,
.cats-holiday-call-btn:hover {
    background: linear-gradient(135deg, #2a4564 0%, #1a2e44 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 46, 68, 0.4);
}

.cats-submit-btn:active,
.cats-book-btn:active,
.cats-holiday-call-btn:active {
    transform: translateY(0);
}

.cats-submit-btn:focus,
.cats-book-btn:focus,
.cats-holiday-call-btn:focus {
    outline: 3px solid #c9a55c;
    outline-offset: 3px;
}

.cats-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cats-secondary-btn,
.cats-retry-btn {
    width: 100%;
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 18px;
    font-weight: 600;
    color: #1a2e44;
    background: #ffffff;
    border: 2px solid #1a2e44;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.cats-secondary-btn:hover,
.cats-retry-btn:hover {
    background: #1a2e44;
    color: #ffffff;
}

.cats-secondary-btn:focus,
.cats-retry-btn:focus {
    outline: 3px solid #c9a55c;
    outline-offset: 2px;
}

/* ====================
   Loading State
   ==================== */
.cats-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.cats-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c9a55c;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: cats-spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes cats-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cats-loading p {
    font-size: 18px;
    color: #555;
    margin: 0;
}

/* ====================
   Results Display
   ==================== */
.cats-results {
    background: #ffffff;
    border: 2px solid #1a2e44;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(26, 46, 68, 0.1);
}

.cats-results h3 {
    color: #1a2e44;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
}

/* Trip Info */
.cats-trip-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.cats-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 18px;
    line-height: 1.5;
}

.cats-info-row:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.cats-info-label {
    font-weight: 600;
    color: #555;
}

.cats-info-value {
    font-weight: 700;
    color: #1a2e44;
}

/* Price Breakdown */
.cats-price-breakdown {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.cats-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    font-size: 18px;
    line-height: 1.5;
}

.cats-breakdown-row:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.cats-breakdown-label {
    flex: 1;
    color: #555;
    font-weight: 500;
}

.cats-breakdown-value {
    font-weight: 700;
    color: #1a2e44;
    margin-left: 1rem;
    white-space: nowrap;
}

.cats-breakdown-hint {
    display: block;
    font-size: 14px;
    color: #888;
    font-weight: 400;
    margin-top: 0.25rem;
}

.cats-out-of-area {
    background: #fff9e6;
    padding: 0.75rem;
    margin: 0.5rem -0.75rem;
    border-radius: 6px;
}

.cats-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0 0.5rem;
    margin-top: 1rem;
    border-top: 3px solid #1a2e44;
}

.cats-total-label {
    font-size: 20px;
    font-weight: 700;
    color: #1a2e44;
}

.cats-total-value {
    font-size: 28px;
    font-weight: 800;
    color: #c9a55c; /* Gold for emphasis */
}

/* CTA Section */
.cats-cta {
    margin-top: 2rem;
}

.cats-disclaimer {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

/* ====================
   Holiday Message
   ==================== */
.cats-holiday-notice {
    text-align: center;
    padding: 2rem 1rem;
}

.cats-holiday-icon {
    font-size: 64px;
    margin-bottom: 1rem;
}

.cats-holiday-notice h4 {
    font-size: 24px;
    font-weight: 700;
    color: #1a2e44;
    margin: 0 0 1rem 0;
}

.cats-holiday-notice p {
    font-size: 18px;
    color: #555;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

/* ====================
   Error Display
   ==================== */
.cats-error {
    background: #fef2f2;
    border: 2px solid #d63638;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
}

.cats-error-message {
    font-size: 18px;
    color: #d63638;
    font-weight: 600;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

/* ====================
   Responsive Design
   ==================== */

/* Tablet */
@media (min-width: 768px) {
    .cats-fare-calculator {
        padding: 1.5rem;
    }
    
    .cats-fare-form {
        padding: 2.5rem;
    }
    
    .cats-fare-form h2 {
        font-size: 32px;
    }
    
    .cats-checkbox-group {
        flex-direction: row;
        gap: 1rem;
    }
    
    .cats-checkbox {
        flex: 1;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .cats-fare-calculator {
        margin: 3rem auto;
    }
    
    .cats-fare-form {
        padding: 3rem;
    }
    
    .cats-results {
        padding: 2.5rem;
    }
}

/* ====================
   Accessibility Enhancements
   ==================== */

/* High contrast focus indicators */
*:focus-visible {
    outline: 3px solid #c9a55c;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cats-submit-btn:hover,
    .cats-book-btn:hover,
    .cats-holiday-call-btn:hover {
        transform: none;
    }
}

/* Screen reader only text */
.cats-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .cats-submit-btn,
    .cats-book-btn,
    .cats-secondary-btn,
    .cats-retry-btn {
        display: none;
    }
    
    .cats-results {
        border: 2px solid #000;
    }
}
