/* Airport Parking Booking - Frontend Styles */

.apb-form-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    direction: rtl;
    line-height: 1.6;
}

.apb-form {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.apb-section-title {
    color: #0073aa;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 12px;
    margin: 35px 0 25px 0;
    font-size: 22px;
    font-weight: 600;
    position: relative;
}

.apb-section-title:first-child {
    margin-top: 0;
}

.apb-section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 50px;
    height: 3px;
    background: #00a0d2;
}

.apb-row {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

.apb-column {
    flex: 1;
    min-width: 0;
}

.apb-field-group {
    margin-bottom: 25px;
}

.apb-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.apb-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
    height: 52px; /* Consistent height for all form fields */
    min-height: 52px;
}

.apb-field:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fafbfc;
}

/* Removed automatic invalid styling to prevent red borders on empty fields */

.apb-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.apb-field-error-msg {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.apb-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeaa7;
    border-right: 4px solid #ffc107;
    padding: 16px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 14px;
    font-weight: 500;
}

.apb-pricing-container {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
    animation: slideIn 0.3s ease-out;
}

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

.apb-pricing-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #0073aa;
    font-size: 18px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.pricing-breakdown {
    font-size: 15px;
}

.pricing-item {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.pricing-item:last-child {
    border-bottom: none;
}

.pricing-item.main-info {
    background: #e7f3ff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: none;
}

.pricing-days {
    font-size: 16px;
    color: #0073aa;
}

.pricing-total {
    background: #0073aa;
    color: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 18px;
    margin-top: 20px;
}

.pricing-loader {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.same-day-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    color: #856404;
}

.apb-terms {
    margin: 35px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.apb-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.6;
    gap: 12px;
}

.apb-checkbox-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
    accent-color: #0073aa;
}

.apb-checkbox-label a {
    color: #0073aa;
    text-decoration: underline;
}

.apb-checkbox-label a:hover {
    text-decoration: none;
}

.apb-submit-section {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
}

.apb-submit-button {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
    text-transform: none;
}

.apb-submit-button:hover {
    background: linear-gradient(135deg, #005a87, #004668);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

.apb-submit-button:active {
    transform: translateY(0);
}

.apb-submit-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-text {
    display: none;
}

/* Messages */
.apb-messages {
    margin-bottom: 25px;
}

.apb-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-right: 4px solid #dc3545;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.apb-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-right: 4px solid #28a745;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.apb-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-right: 4px solid #ffc107;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .apb-form {
        padding: 25px 20px;
        margin: 0 10px;
    }
    
    .apb-row {
        flex-direction: column;
        gap: 0;
    }
    
    .apb-section-title {
        font-size: 18px;
        margin: 25px 0 20px 0;
    }
    
    .apb-field {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .apb-submit-button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
    
    .apb-checkbox-label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .apb-form-container {
        margin: 0;
    }
    
    .apb-form {
        border-radius: 0;
        margin: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #dee2e6;
        border-bottom: 1px solid #dee2e6;
    }
}

/* Accessibility improvements */
.apb-field:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.apb-submit-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Enhanced select styling */
select.apb-field {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
    padding-left: 35px;
}

/* Date and Time fields - let browser handle native icons */
.apb-field[type="date"],
.apb-field[type="time"] {
    /* Remove custom background icons to prevent conflicts with browser native controls */
    padding-left: 16px;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.apb-submit-button .loading-text::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Custom checkbox styling */
.apb-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #0073aa;
    border-radius: 3px;
    background: white;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.apb-checkbox-label input[type="checkbox"]:checked {
    background: #0073aa;
    border-color: #0073aa;
}

.apb-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Hover effects */
.apb-field:hover:not(:focus) {
    border-color: #999;
}

select.apb-field:hover:not(:focus),
.apb-field[type="date"]:hover:not(:focus),
.apb-field[type="time"]:hover:not(:focus) {
    border-color: #999;
}

/* Form validation styling - only apply to submitted forms */
.apb-form.submitted .apb-field:valid {
    border-color: #28a745;
}

.apb-form.submitted .apb-field:invalid {
    border-color: #dc3545;
}

.apb-field:valid:focus,
.apb-field:invalid:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .apb-form {
        background: #1e1e1e;
        color: #ffffff;
        border-color: #444;
    }
    
    .apb-field {
        background: #2d2d2d;
        border-color: #444;
        color: #ffffff;
    }
    
    .apb-field:focus {
        background: #333;
        border-color: #0073aa;
    }
    
    .apb-label {
        color: #ffffff;
    }
    
    .apb-section-title {
        color: #4fc3f7;
        border-bottom-color: #4fc3f7;
    }
    
    .apb-section-title::after {
        background: #29b6f6;
    }
}

/* Print styles */
@media print {
    .apb-submit-section,
    .apb-messages {
        display: none;
    }
    
    .apb-form {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .apb-field {
        border-width: 3px;
    }
    
    .apb-submit-button {
        border: 3px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .apb-field,
    .apb-submit-button,
    .apb-pricing-container {
        transition: none;
    }
    
    .apb-submit-button .loading-text::after {
        animation: none;
    }
}

/* Additional utility classes */
.apb-text-center {
    text-align: center;
}

.apb-text-right {
    text-align: right;
}

.apb-text-left {
    text-align: left;
}

.apb-mb-10 {
    margin-bottom: 10px;
}

.apb-mb-20 {
    margin-bottom: 20px;
}

.apb-mt-20 {
    margin-top: 20px;
}

/* Custom styling for specific field types */
input[type="tel"].apb-field {
    font-family: monospace, sans-serif;
    letter-spacing: 1px;
}

input[type="email"].apb-field {
    direction: ltr;
    text-align: right;
}

/* Enhanced accessibility for screen readers */
.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;
}

/* Focus management for keyboard navigation */
.apb-form input:focus,
.apb-form select:focus,
.apb-form button:focus {
    z-index: 1;
    position: relative;
}

/* Enhanced error state styling */
.apb-field-group.has-error .apb-field {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.apb-field-group.has-error .apb-label {
    color: #dc3545;
}

/* Success state styling */
.apb-field-group.has-success .apb-field {
    border-color: #28a745;
}

.apb-field-group.has-success .apb-field::after {
    content: '✓';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: bold;
}

/* Loading overlay */
.apb-form.loading {
    position: relative;
    pointer-events: none;
}

.apb-form.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
}

/* Tooltip styling for help text */
.apb-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.apb-tooltip .apb-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    right: 50%;
    margin-right: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
}

.apb-tooltip:hover .apb-tooltip-text {
    visibility: visible;
    opacity: 1;
}