/* Locky Frontend Styles */

/* Locker Selection Interface */
.locky-locker-selection {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.locky-locker-selection h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.locky-locker-selection h3::before {
    content: "🗄️";
    font-size: 20px;
}

.locker-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.locker-option {
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.locker-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.15);
}

.locker-option.selected {
    border-color: #00a32a;
    background: #f0f9f0;
    box-shadow: 0 0 0 1px #00a32a;
}

.locker-option input[type="radio"] {
    display: none;
}

.locker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.locker-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.locker-type {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.locker-type.normal {
    background: #e3f2fd;
    color: #1565c0;
}

.locker-type.freezer {
    background: #e8f5e8;
    color: #2e7d32;
}

.locker-location {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.locker-location::before {
    content: "📍";
    font-size: 12px;
}

.locker-availability {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.availability-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.availability-indicator.available {
    background: #00a32a;
}

.availability-indicator.limited {
    background: #f39c12;
}

.availability-indicator.full {
    background: #dc3545;
}

.availability-text {
    color: #666;
}

/* No lockers available state */
.no-lockers-available {
    text-align: center;
    padding: 40px 20px;
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 8px;
    margin: 20px 0;
}

.no-lockers-available .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-lockers-available h3 {
    color: #f57c00;
    margin-bottom: 10px;
}

.no-lockers-available p {
    color: #666;
    margin-bottom: 0;
}

/* Loading states */
.locky-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fafafa;
    border-radius: 8px;
    margin: 20px 0;
}

.locky-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

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

.loading-text {
    color: #666;
    font-size: 16px;
}

/* Pickup Interface */
.locky-pickup-interface {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pickup-header {
    text-align: center;
    margin-bottom: 25px;
}

.pickup-header h2 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pickup-header h2::before {
    content: "🔓";
    font-size: 24px;
}

.pickup-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

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

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

.pickup-code-input {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pickup-button {
    width: 100%;
    background: linear-gradient(135deg, #00a32a 0%, #007c20 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pickup-button:hover {
    background: linear-gradient(135deg, #007c20 0%, #005a17 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,163,42,0.3);
}

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

.pickup-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Messages */
.pickup-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.pickup-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pickup-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pickup-result.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Order Information Display */
.order-locker-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.order-locker-info h3 {
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-locker-info h3::before {
    content: "🗄️";
    font-size: 20px;
}

.locker-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-section h4 {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section .value {
    font-size: 16px;
    color: #212529;
    font-weight: 500;
}

.pickup-code-display {
    background: #007cba;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    display: inline-block;
}

.status-notice {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid;
}

.status-notice.processing {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.status-notice.ready {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.status-notice.expired {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Customer Account Styles */
.locky-customer-pickups {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.locky-customer-pickups h3 {
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.locky-customer-pickups h3::before {
    content: "📦";
    font-size: 20px;
}

.pickups-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.pickups-table th,
.pickups-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.pickups-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.pickups-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-assigned {
    background: #fff3cd;
    color: #856404;
}

.status-delivered {
    background: #cce7ff;
    color: #0c5460;
}

.status-collected {
    background: #d1eddb;
    color: #0f5132;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .locker-options {
        grid-template-columns: 1fr;
    }
    
    .locky-locker-selection,
    .locky-pickup-interface,
    .order-locker-info {
        margin: 15px 0;
        padding: 15px;
    }
    
    .locker-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pickup-form {
        max-width: none;
    }
    
    .pickups-table {
        font-size: 14px;
    }
    
    .pickups-table th,
    .pickups-table td {
        padding: 8px 4px;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 480px) {
        .pickups-table,
        .pickups-table thead,
        .pickups-table tbody,
        .pickups-table th,
        .pickups-table td,
        .pickups-table tr {
            display: block;
        }
        
        .pickups-table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .pickups-table tr {
            border: 1px solid #ccc;
            margin-bottom: 10px;
            padding: 10px;
            border-radius: 6px;
        }
        
        .pickups-table td {
            border: none;
            padding: 5px 0;
            position: relative;
            padding-left: 50%;
        }
        
        .pickups-table td:before {
            content: attr(data-title) ": ";
            position: absolute;
            left: 6px;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: 600;
        }
    }
}

/* Print Styles */
@media print {
    .pickup-button,
    .locker-option:not(.selected) {
        display: none !important;
    }
    
    .order-locker-info {
        border: 2px solid #000;
        break-inside: avoid;
    }
    
    .pickup-code-display {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Accessibility Improvements */
.locker-option:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.pickup-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.form-field input:focus {
    outline: none; /* We're using border and box-shadow instead */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .locker-option {
        border-width: 3px;
    }
    
    .locker-option.selected {
        border-width: 4px;
    }
    
    .status-badge {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .locker-option,
    .pickup-button,
    .locky-spinner {
        transition: none;
        animation: none;
    }
    
    .locker-option:hover,
    .pickup-button:hover {
        transform: none;
    }
}