/**
 * Public Styles
 *
 * @package AithyraM365Booking
 */

:root {
    --am365b-primary: #2271b1;
    --am365b-success: #28a745;
    --am365b-danger: #dc3545;
    --am365b-warning: #ffc107;
    --am365b-info: #17a2b8;
}

/* Calendar Styles (see templates/calendar/calendar.php for more) */
.am365b-calendar-event {
    padding: 5px;
    margin: 2px 0;
    background: var(--am365b-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am365b-calendar-event:hover {
    background: #135e96;
}

.am365b-calendar-event-title {
    font-weight: 600;
}

.am365b-calendar-event-time {
    font-size: 11px;
    opacity: 0.9;
}

/* Resource List */
.am365b-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.am365b-resource-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.am365b-resource-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.am365b-resource-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.am365b-resource-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.am365b-resource-type {
    display: inline-block;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.am365b-resource-details {
    margin: 15px 0;
    color: #666;
}

.am365b-resource-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.am365b-resource-actions {
    margin-top: 15px;
}

/* Booking Form */
.am365b-booking-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

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

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

.am365b-form-label.required::after {
    content: ' *';
    color: var(--am365b-danger);
}

.am365b-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.am365b-form-control:focus {
    outline: none;
    border-color: var(--am365b-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.am365b-form-control.error {
    border-color: var(--am365b-danger);
}

.am365b-form-help {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.am365b-form-error {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--am365b-danger);
}

.am365b-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Buttons */
.am365b-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--am365b-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.am365b-button:hover {
    background: #135e96;
    color: #fff;
}

.am365b-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.am365b-button-secondary {
    background: #6c757d;
}

.am365b-button-secondary:hover {
    background: #5a6268;
}

.am365b-button-success {
    background: var(--am365b-success);
}

.am365b-button-success:hover {
    background: #218838;
}

.am365b-button-danger {
    background: var(--am365b-danger);
}

.am365b-button-danger:hover {
    background: #c82333;
}

/* My Bookings */
.am365b-bookings-list {
    margin: 20px 0;
}

.am365b-booking-item {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid var(--am365b-primary);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.am365b-booking-item.past {
    opacity: 0.7;
    border-left-color: #999;
}

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

.am365b-booking-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.am365b-booking-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.am365b-booking-status.confirmed {
    background: #d4edda;
    color: #155724;
}

.am365b-booking-status.pending {
    background: #fff3cd;
    color: #856404;
}

.am365b-booking-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.am365b-booking-details {
    color: #666;
    line-height: 1.6;
}

.am365b-booking-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.am365b-booking-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Alerts */
.am365b-alert {
    padding: 15px 20px;
    margin: 20px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.am365b-alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.am365b-alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.am365b-alert-warning {
    background: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.am365b-alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Loading */
.am365b-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.am365b-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--am365b-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .am365b-resources-grid {
        grid-template-columns: 1fr;
    }

    .am365b-booking-form {
        padding: 20px;
    }

    .am365b-booking-header {
        flex-direction: column;
        gap: 10px;
    }

    .am365b-booking-actions {
        flex-direction: column;
    }

    .am365b-button {
        width: 100%;
        text-align: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .am365b-resource-card,
    .am365b-booking-form,
    .am365b-booking-item {
        background: #2c2c2c;
        border-color: #444;
        color: #e0e0e0;
    }

    .am365b-resource-title,
    .am365b-booking-title,
    .am365b-form-label {
        color: #e0e0e0;
    }

    .am365b-form-control {
        background: #3a3a3a;
        border-color: #555;
        color: #e0e0e0;
    }
}
