/**
 * BACC Events Manager Styles
 */

/* Login Form */
.bacc-em-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 20px;
}

.bacc-em-login-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bacc-em-login-container h2 {
    margin-top: 0;
    color: #333;
}

/* Dashboard */
.bacc-em-dashboard {
    padding: 20px;
    background: #f5f5f5;
    min-height: 600px;
}

.bacc-em-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.bacc-em-header h2 {
    margin: 0;
    color: #333;
}

/* Controls */
.bacc-em-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.bacc-em-search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.bacc-em-search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bacc-em-actions {
    display: flex;
    gap: 10px;
}

/* View Toggle */
.bacc-em-view-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #fff;
    padding: 5px;
    border-radius: 4px;
    width: fit-content;
}

.bacc-em-view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.bacc-em-view-btn:hover {
    background: #f0f0f0;
}

.bacc-em-view-btn.active {
    background: #007cba;
    color: white;
}

/* Events Table */
.bacc-em-events-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bacc-em-events-table {
    width: 100%;
    border-collapse: collapse;
}

.bacc-em-events-table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.bacc-em-events-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.bacc-em-event-row:hover {
    background: #f8f9fa;
}

.bacc-em-floating-night {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.bacc-em-no-events {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px !important;
}

/* Badges and Status */
.bacc-em-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    margin-left: 5px;
}

.bacc-em-badge-warning {
    background: #ffc107;
    color: #856404;
}

.bacc-em-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.bacc-em-status-publish {
    background: #d4edda;
    color: #155724;
}

.bacc-em-status-draft {
    background: #cce5ff;
    color: #004085;
}

.bacc-em-status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Action Buttons */
.bacc-em-action-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 4px 8px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.bacc-em-action-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Buttons */
.bacc-em-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bacc-em-btn-primary {
    background: #007cba;
    color: white;
}

.bacc-em-btn-primary:hover {
    background: #005a87;
}

.bacc-em-btn-secondary {
    background: #6c757d;
    color: white;
}

.bacc-em-btn-secondary:hover {
    background: #545b62;
}

.bacc-em-btn-success {
    background: #28a745;
    color: white;
}

.bacc-em-btn-success:hover {
    background: #218838;
}

.bacc-em-btn-danger {
    background: #dc3545;
    color: white;
}

.bacc-em-btn-danger:hover {
    background: #c82333;
}

/* Modal */
.bacc-em-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bacc-em-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.bacc-em-modal-small {
    max-width: 400px;
}

.bacc-em-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.bacc-em-modal-close:hover {
    color: #333;
}

.bacc-em-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Forms */
.bacc-em-form-group {
    margin-bottom: 15px;
}

.bacc-em-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.bacc-em-form-group input[type="text"],
.bacc-em-form-group input[type="password"],
.bacc-em-form-group input[type="email"],
.bacc-em-form-group input[type="url"],
.bacc-em-form-group input[type="datetime-local"],
.bacc-em-form-group select,
.bacc-em-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.bacc-em-form-group input[type="checkbox"] {
    margin-right: 5px;
}

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

.bacc-em-form-half {
    flex: 1;
}

.bacc-em-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Delete Warning */
.bacc-em-delete-warning {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Messages */
.bacc-em-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.bacc-em-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bacc-em-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Session Timer */
.bacc-em-session-timer {
    position: fixed;
    top: 32px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9998;
}

.bacc-em-session-timer.warning {
    background: #dc3545;
}

/* Spinner */
.bacc-em-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .bacc-em-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bacc-em-search-box {
        max-width: 100%;
    }

    .bacc-em-actions {
        justify-content: center;
    }

    .bacc-em-events-table {
        font-size: 12px;
    }

    .bacc-em-events-table thead th,
    .bacc-em-events-table tbody td {
        padding: 8px 4px;
    }

    .bacc-em-modal-content {
        width: 95%;
        padding: 20px;
    }

    .bacc-em-form-row {
        flex-direction: column;
    }

    .bacc-em-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Hide less important columns on mobile */
    .bacc-em-events-table th:nth-child(4),
    .bacc-em-events-table td:nth-child(4) {
        display: none;
    }
}

/* Calendar View Styles */
.bacc-em-calendar-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#bacc-em-calendar {
    min-height: 500px;
}

.bacc-em-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.bacc-em-calendar-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.bacc-em-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.bacc-em-calendar-weekday {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #dee2e6;
}

.bacc-em-calendar-weekday:last-child {
    border-right: none;
}

.bacc-em-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(100px, auto);
    border: 1px solid #dee2e6;
}

.bacc-em-calendar-day {
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px;
    min-height: 100px;
    background: #fff;
    position: relative;
}

.bacc-em-calendar-day:nth-child(7n) {
    border-right: none;
}

.bacc-em-calendar-day-other {
    background: #f8f9fa;
    color: #6c757d;
}

.bacc-em-calendar-day-today {
    background: #e7f3ff;
}

.bacc-em-calendar-day-today .bacc-em-calendar-day-number {
    background: #007cba;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bacc-em-calendar-day-has-events {
    background: #f0f8ff;
}

.bacc-em-calendar-day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.bacc-em-calendar-day-events {
    font-size: 11px;
    margin-top: 5px;
}

.bacc-em-calendar-event {
    background: #007cba;
    color: white;
    padding: 2px 4px;
    margin: 2px 0;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bacc-em-calendar-event:hover {
    background: #005a87;
}

.bacc-em-calendar-event-time {
    font-weight: bold;
    font-size: 10px;
}

.bacc-em-calendar-event-title {
    font-size: 10px;
}

.bacc-em-calendar-event .bacc-em-badge {
    font-size: 8px;
    padding: 1px 3px;
    margin-left: 2px;
}

/* Loading State */
.bacc-em-loading {
    opacity: 0.6;
    pointer-events: none;
}

.bacc-em-loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
}