/**
 * APK Booking Frontend Styles
 * Colors: Primary #2fa7de, Secondary #405ba9
 */

/* Main Container with background */
.apk-booking-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 25px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: relative;
    background: linear-gradient(135deg, #f5fafd 0%, #eef6fb 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(64, 91, 169, 0.1);
}

/* Steps Indicator */
.apk-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.apk-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.apk-step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #d0dce5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.apk-step-indicator.active {
    background-color: #2fa7de;
    color: white;
}

.apk-step-indicator.completed {
    background-color: #405ba9;
    color: white;
}

.apk-step-label {
    font-size: 11px;
    color: #666;
    text-align: center;
}

.apk-step-line {
    flex: 1;
    height: 2px;
    background-color: #d0dce5;
    margin: 0 8px;
    margin-bottom: 24px;
    max-width: 60px;
}

/* Section Titles */
.apk-section-title {
    color: #405ba9;
    font-size: 20px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.apk-section-description {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Calendar - removed separate container, integrated into main */
.apk-calendar-container {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.apk-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.apk-calendar-month-year {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.apk-calendar-nav {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #405ba9;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.apk-calendar-nav:hover {
    background: #f0f0f0;
    border-color: #2fa7de;
}

.apk-calendar-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.apk-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}

.apk-calendar-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    padding: 6px 0;
}

.apk-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.apk-calendar-day {
    width: 100%;
    padding-top: 100%; /* Creates square aspect ratio */
    position: relative;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: default;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background: #f0f0f0;
    color: #bbb;
    box-sizing: border-box;
}

.apk-calendar-day span {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apk-calendar-day.empty {
    background: transparent;
    border: none;
}

.apk-calendar-day.unavailable {
    color: #bbb;
    background: #f0f0f0;
}

.apk-calendar-day.weekend {
    color: #bbb;
    background: #f0f0f0;
}

.apk-calendar-day.available {
    color: #333;
    cursor: pointer;
    background: #e3f2fd;
    border-color: #bbdefb;
    font-weight: 600;
}

.apk-calendar-day.available:hover {
    background: #2fa7de;
    color: white;
    border-color: #2fa7de;
}

.apk-calendar-day.selected {
    background: #2fa7de;
    color: white;
    border-color: #2fa7de;
    font-weight: 700;
}

.apk-calendar-day.today {
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #405ba9;
}

/* Selected Date Display */
.apk-selected-date-display {
    background: #fff;
    border: 1px solid #2fa7de;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
    font-size: 14px;
}

.apk-selected-date-display strong {
    color: #405ba9;
}

/* Time Selection */
.apk-time-selection {
    margin-bottom: 15px;
}

.apk-hint {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Form Styles */
.apk-form {
    margin-bottom: 15px;
}

.apk-form-group {
    margin-bottom: 15px;
}

.apk-form-row {
    display: flex;
    gap: 15px;
}

.apk-form-half {
    flex: 1;
}

.apk-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.apk-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

.apk-form-input:focus {
    outline: none;
    border-color: #2fa7de;
    box-shadow: 0 0 0 3px rgba(47, 167, 222, 0.15);
}

.apk-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #fff;
    padding-right: 35px;
}

.apk-form-textarea {
    resize: vertical;
    min-height: 70px;
}

.apk-license-input {
    text-transform: uppercase;
    max-width: 180px;
}

/* Buttons */
.apk-button-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.apk-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.apk-btn-primary {
    background-color: #2fa7de;
    color: white;
}

.apk-btn-primary:hover {
    background-color: #405ba9;
}

.apk-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.apk-btn-secondary {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.apk-btn-secondary:hover {
    background-color: #f5f5f5;
}

/* Confirmation */
.apk-confirmation {
    text-align: center;
    padding: 20px 15px;
}

.apk-confirmation-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #2fa7de, #405ba9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 35px;
    color: white;
}

.apk-confirmation-text {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.apk-confirmation-text strong {
    color: #405ba9;
}

.apk-confirmation-box {
    background: #fff;
    border: 1px solid #2fa7de;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    font-size: 15px;
    color: #405ba9;
}

.apk-confirmation-contact {
    font-size: 12px;
    color: #888;
    margin-top: 15px;
}

/* Loading */
.apk-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 250, 253, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    border-radius: 16px;
}

.apk-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #d0dce5;
    border-top-color: #2fa7de;
    border-radius: 50%;
    animation: apk-spin 0.8s linear infinite;
}

@keyframes apk-spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.apk-error-message {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
}

/* Intro section inside container */
.apk-booking-intro {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(64, 91, 169, 0.1);
}

.apk-booking-intro-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #405ba9;
}

.apk-booking-intro-text {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Legacy styles for backwards compatibility */
.apk-booking-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.apk-booking-description {
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 520px) {
    .apk-booking-container {
        padding: 20px 15px;
        border-radius: 12px;
        margin: 0 10px;
    }
    
    .apk-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .apk-form-half {
        width: 100%;
    }
    
    .apk-button-row {
        flex-direction: column;
    }
    
    .apk-btn {
        width: 100%;
    }
    
    .apk-steps {
        padding: 0;
    }
    
    .apk-step-label {
        font-size: 10px;
    }
    
    .apk-step-indicator {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .apk-step-line {
        max-width: 40px;
    }
    
    .apk-calendar-container {
        padding: 12px;
    }
    
    .apk-calendar-days {
        gap: 3px;
    }
    
    .apk-calendar-day {
        font-size: 12px;
        border-radius: 4px;
    }
    
    .apk-calendar-day span {
        font-size: 12px;
    }
    
    .apk-section-title {
        font-size: 18px;
    }
}
