/* Public Form Styles for Library Reservations Plugin */
/* Requirements FR019, FR020: Mobile-Friendly and Accessible */

.dp-library-reservation-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Upcoming Blackouts */
.dp-upcoming-blackouts {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.dp-upcoming-blackouts h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
    font-size: 1.2em;
}

.dp-upcoming-blackouts p {
    margin: 5px 0 10px 0;
    color: #856404;
}

.dp-upcoming-blackouts ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.dp-upcoming-blackouts li {
    margin-bottom: 8px;
    color: #856404;
}

.dp-upcoming-blackouts .blackout-reason {
    color: #666;
    font-style: italic;
}

/* Messages */
#dp-reservation-messages {
    margin-bottom: 20px;
}

#dp-reservation-messages-bottom {
    margin-top: 20px;
    margin-bottom: 20px;
}

.dp-message {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 3px;
    border-left: 4px solid;
}

.dp-message-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.dp-message-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.dp-message-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3em;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.required {
    color: #dc3545;
}

/* Form Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

.form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
}

/* Room Selection */
#dp-room-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    #dp-room-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.room-option {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-option:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.room-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.room-option input[type="radio"]:checked + .room-option-label {
    background: #e7f5ff;
}

.room-option input[type="radio"]:checked ~ .room-option {
    border-color: #0073aa;
    background: #e7f5ff;
}

.room-option.selected {
    border-color: #0073aa;
    background: #e7f5ff;
}

.room-option-label {
    display: block;
}

.room-name {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #333;
}

.room-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.room-capacity {
    color: #888;
    font-size: 0.85em;
}

/* Equipment Selection */
.equipment-option {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: #f8f9fa;
}

.equipment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.equipment-header input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.equipment-name {
    font-weight: 600;
    color: #333;
}

.equipment-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.equipment-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.equipment-quantity label {
    margin: 0;
    font-weight: normal;
}

.equipment-quantity input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.equipment-available {
    color: #28a745;
    font-size: 0.9em;
}

/* Loading State */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-message::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

.dp-submit-button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dp-submit-button:hover {
    background: #005a87;
}

.dp-submit-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.button-loading {
    display: inline-block;
}

.button-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

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

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .dp-library-reservation-form {
        border: 2px solid #000;
    }
    
    .form-group input,
    .form-group select {
        border: 2px solid #000;
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    .dp-library-reservation-form {
        padding: 15px;
    }
    
    .form-section h3 {
        font-size: 1.2em;
    }
    
    .dp-submit-button {
        width: 100%;
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .dp-submit-button,
    .form-actions {
        display: none;
    }
}
