/**
 * Frontend Booking Form Styles
 * 
 * @package VarastokisalliBooking
 * @since 1.0.0
 */

/* Reset and Base Styles */
.vk-booking-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.vk-booking-form * {
    box-sizing: border-box;
}

/* Progress Indicator */
.vk-progress-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.vk-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 200px;
}

.vk-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.vk-progress-step.vk-active::after,
.vk-progress-step.vk-completed::after {
    background: #2271b1;
}

.vk-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.vk-progress-step.vk-active .vk-step-number {
    background: #2271b1;
    color: white;
}

.vk-progress-step.vk-completed .vk-step-number {
    background: #10b981;
    color: white;
}

.vk-progress-step.vk-completed .vk-step-number::before {
    content: '✓';
    font-size: 18px;
}

.vk-step-label {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: #666;
}

.vk-progress-step.vk-active .vk-step-label {
    color: #2271b1;
}

.vk-progress-step.vk-completed .vk-step-label {
    color: #10b981;
}

/* Steps */
.vk-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.vk-step.vk-active {
    display: block;
}

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

.vk-step-header {
    text-align: center;
    margin-bottom: 40px;
}

.vk-step-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 10px 0;
}

.vk-step-header p {
    font-size: 16px;
    color: #646970;
    margin: 0;
}

/* Storage Selection */
.vk-storage-selection {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
}

.vk-filters {
    background: #f6f7f7;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.vk-filter-group {
    margin-bottom: 20px;
}

.vk-filter-group:last-child {
    margin-bottom: 0;
}

.vk-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.vk-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.vk-filter-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.vk-storage-display {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    overflow: hidden;
}

.vk-view-toggle {
    display: flex;
    border-bottom: 1px solid #ccd0d4;
    background: #f6f7f7;
}

.vk-toggle-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #646970;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vk-toggle-btn:hover {
    background: #e0e0e0;
    color: #1d2327;
}

.vk-toggle-btn.vk-active {
    background: white;
    color: #2271b1;
    border-bottom: 2px solid #2271b1;
}

.vk-storage-map-container {
    height: 400px;
    position: relative;
}

.vk-storage-map {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vk-map-placeholder {
    text-align: center;
    color: #646970;
}

.vk-storage-list {
    padding: 20px;
}

.vk-storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.vk-storage-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.vk-storage-card:hover {
    border-color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vk-storage-card.vk-selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.vk-storage-card.vk-unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.vk-storage-number {
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 8px;
}

.vk-storage-details {
    font-size: 14px;
    color: #646970;
    margin-bottom: 12px;
}

.vk-storage-price {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.vk-selected-storage {
    margin-top: 20px;
}

.vk-selected-storage .vk-storage-card {
    background: #f0f6fc;
    border-color: #2271b1;
    cursor: default;
}

.vk-change-storage {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.3s ease;
}

.vk-change-storage:hover {
    background: #1a5a8a;
}

/* Time Selection */
.vk-time-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.vk-date-selection {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.vk-form-group {
    margin-bottom: 20px;
}

.vk-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.vk-form-group input,
.vk-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

/* Calendar/date input enhancements */
#vk-start-date {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23646970" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    padding-right: 44px;
}

/* Hide default calendar icon in WebKit */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    display: block;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Hover/focus for date input */
#vk-start-date:hover {
    border-color: #b6bbc1;
}

#vk-start-date:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.vk-form-group input:focus,
.vk-form-group select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.vk-duration-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vk-duration-btn {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #646970;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vk-duration-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.vk-duration-btn.vk-active {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

.vk-price-calculation {
    background: #f6f7f7;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

/* Theming support */
.vk-booking-form.vk-theme-dark {
    color: #e2e8f0;
}

.vk-booking-form.vk-theme-dark .vk-filters,
.vk-booking-form.vk-theme-dark .vk-price-calculation,
.vk-booking-form.vk-theme-dark .vk-storage-display,
.vk-booking-form.vk-theme-dark .vk-storage-card,
.vk-booking-form.vk-theme-dark .vk-storage-list {
    background: #0f172a;
    border-color: #1e293b;
}

.vk-booking-form.vk-theme-dark .vk-toggle-btn {
    color: #a1a1aa;
}

.vk-booking-form.vk-theme-dark .vk-toggle-btn.vk-active {
    background: #0f172a;
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.vk-booking-form.vk-theme-dark .vk-storage-card {
    background: #0b1220;
}

.vk-booking-form.vk-theme-dark .vk-storage-card.vk-selected {
    background: #0a2540;
    border-color: #60a5fa;
}

.vk-booking-form.vk-theme-dark .vk-storage-number {
    color: #60a5fa;
}

.vk-booking-form.vk-theme-dark .vk-form-group input,
.vk-booking-form.vk-theme-dark .vk-form-group select {
    background: #0b1220;
    border-color: #1e293b;
    color: #e2e8f0;
}

.vk-booking-form.vk-theme-dark #vk-start-date {
    background-color: #0b1220;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23a1a1aa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>');
}

.vk-booking-form.vk-theme-dark .vk-change-storage {
    background: #2563eb;
}

.vk-booking-form.vk-theme-dark .vk-duration-btn.vk-active {
    background: #2563eb;
    border-color: #2563eb;
}

.vk-price-breakdown {
    margin-bottom: 20px;
}

.vk-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.vk-price-total {
    font-weight: 700;
    font-size: 18px;
    color: #1d2327;
    border-top: 2px solid #2271b1;
    padding-top: 12px;
    margin-top: 12px;
}

.vk-price-label {
    color: #646970;
}

.vk-price-value {
    font-weight: 600;
    color: #1d2327;
}

.vk-campaign-code {
    margin-top: 20px;
}

.vk-toggle-campaign {
    background: none;
    border: none;
    color: #2271b1;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.vk-campaign-input {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.vk-campaign-input input {
    flex: 1;
    margin-bottom: 0;
}

.vk-campaign-feedback {
    margin-top: 10px;
    font-size: 14px;
}

.vk-campaign-feedback.vk-success {
    color: #10b981;
}

.vk-campaign-feedback.vk-error {
    color: #ef4444;
}

/* Customer Form */
.vk-customer-form {
    max-width: 600px;
    margin: 0 auto;
}

.vk-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.vk-form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.vk-terms-link {
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.vk-terms-link:hover {
    text-decoration: underline;
}

/* Confirmation */
.vk-confirmation {
    max-width: 800px;
    margin: 0 auto;
}

.vk-summary-card {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.vk-summary-card h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1d2327;
}

.vk-summary-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.vk-summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.vk-summary-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2271b1;
    font-weight: 600;
}

.vk-summary-content {
    font-size: 14px;
    color: #646970;
    line-height: 1.5;
}

.vk-payment-info {
    background: #f0f6fc;
    border: 1px solid #c3d4f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.vk-payment-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #2271b1;
    font-size: 14px;
}

.vk-payment-notice .dashicons {
    font-size: 20px;
}

/* Navigation */
.vk-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.vk-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.vk-btn-primary {
    background: #2271b1;
    color: white;
}

.vk-btn-primary:hover {
    background: #1a5a8a;
    transform: translateY(-1px);
}

.vk-btn-secondary {
    background: #f6f7f7;
    color: #646970;
    border: 1px solid #ccd0d4;
}

.vk-btn-secondary:hover {
    background: #e0e0e0;
    color: #1d2327;
}

/* Loading States */
.vk-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.vk-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Success Message */
.vk-success-message {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    margin: 20px 0;
}

.vk-success-icon {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 20px;
}

.vk-success-message h3 {
    font-size: 24px;
    color: #1d2327;
    margin: 0 0 10px 0;
}

.vk-success-message p {
    font-size: 16px;
    color: #646970;
    margin: 0 0 20px 0;
}

.vk-booking-details {
    background: #f6f7f7;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

/* Error States */
.vk-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 5px;
}

.vk-form-group.error input,
.vk-form-group.error select {
    border-color: #ef4444;
}

.vk-form-group.error label {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vk-booking-form {
        padding: 10px;
    }
    
    .vk-progress-indicator {
        flex-direction: column;
        gap: 20px;
    }
    
    .vk-progress-step:not(:last-child)::after {
        display: none;
    }
    
    .vk-storage-selection {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vk-time-selection {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .vk-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .vk-duration-options {
        justify-content: center;
    }
    
    .vk-storage-grid {
        grid-template-columns: 1fr;
    }
    
    .vk-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .vk-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .vk-step-header h2 {
        font-size: 24px;
    }
    
    .vk-storage-card {
        padding: 15px;
    }
    
    .vk-summary-card {
        padding: 20px;
    }
    
    .vk-duration-options {
        flex-direction: column;
    }
    
    .vk-duration-btn {
        width: 100%;
        text-align: center;
    }
}

/* Theme Variations */
.vk-theme-dark {
    background: #1d2327;
    color: #f0f0f1;
}

.vk-theme-dark .vk-step-header h2 {
    color: #f0f0f1;
}

.vk-theme-dark .vk-storage-card {
    background: #2c3338;
    border-color: #3c434a;
    color: #f0f0f1;
}

.vk-theme-dark .vk-filters {
    background: #2c3338;
    border-color: #3c434a;
}

/* Accessibility */
.vk-booking-form:focus-within {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.vk-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.vk-storage-card:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .vk-navigation,
    .vk-loading-overlay {
        display: none;
    }
    
    .vk-booking-form {
        max-width: none;
        padding: 0;
    }
}
