/**
 * Librarian Bookings Interface Styles
 * Professional dashboard design with color-coded availability
 */

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.card h2,
.card h3 {
    margin-top: 0;
    color: #333;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.date-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.75rem 1rem;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* Schedule Table */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.schedule-table thead {
    background-color: #f8f9ff;
}

.schedule-table th {
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #555;
    border: 1px solid #e0e0e0;
}

.schedule-table th small {
    font-size: 0.8rem;
    color: #888;
}

.hour-cell {
    background-color: #f8f9ff;
    font-weight: 600;
    text-align: center;
    padding: 1rem 0.5rem;
    border: 1px solid #e0e0e0;
}

.schedule-cell {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 60px;
    vertical-align: top;
}

.schedule-cell:hover {
    background-color: #f8f9ff;
    transform: scale(1.02);
}

.schedule-cell.available {
    background-color: #d1fae5; /* Green - Clearly available */
    border-color: #34d399;
}

.schedule-cell.busy {
    background-color: #fef08a; /* Yellow - Getting busy */
    border-color: #facc15;
}

.schedule-cell.full {
    background-color: #fca5a5; /* Red - Full */
    border-color: #f87171;
}

.cell-count {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.cell-teachers {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}

/* Statistics Panel */
.stats-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-panel h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Hourly Summary Chart */
.hourly-summary {
    margin-bottom: 2rem;
}

.hourly-bars {
    display: grid;
    gap: 0.75rem;
}

.hourly-bar-item {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 1rem;
    align-items: center;
}

.hourly-bar-label {
    font-weight: 600;
}

.hourly-bar-container {
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
}

.hourly-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #86efac 0%, #22c55e 100%);
    transition: width 0.3s;
}

.hourly-bar-count {
    text-align: center;
    font-weight: 600;
}

/* Bookings Table */
.bookings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.bookings-table thead {
    background-color: #f8f9ff;
}

.bookings-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #667eea;
}

.bookings-table td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.bookings-table tbody tr:hover {
    background-color: #f8f9ff;
}

/* Type Badge */
.type-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.type-recurring {
    background-color: #dbeafe;
    color: #1e40af;
}

.type-onetime {
    background-color: #fef3c7;
    color: #92400e;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-picked-up {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Recurring Schedule */
.recurring-cell {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    vertical-align: top;
    min-height: 60px;
}

.recurring-cell.empty {
    background-color: #fafafa;
}

.recurring-item {
    background-color: #f8f9ff;
    border: 1px solid #667eea;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.recurring-item:last-child {
    margin-bottom: 0;
}

.recurring-teacher {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.recurring-quantity {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.recurring-actions {
    display: flex;
    gap: 0.25rem;
}

.recurring-actions .btn-icon {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    border: none;
    background: none;
}

.recurring-actions .btn-icon:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-small {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background-color: #667eea;
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #888;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-right: 4px solid #22c55e;
}

.toast-error {
    border-right: 4px solid #ef4444;
}

.toast-info {
    border-right: 4px solid #3b82f6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .schedule-table {
        font-size: 0.8rem;
    }

    .cell-teachers {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .view-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .schedule-table {
        font-size: 0.7rem;
    }

    .schedule-cell {
        padding: 0.5rem 0.25rem;
        min-height: 50px;
    }

    .cell-count {
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .bookings-table {
        font-size: 0.85rem;
    }

    .bookings-table th,
    .bookings-table td {
        padding: 0.5rem;
    }
}
.computer-id-input {
    width: 80px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.header-date {
    font-size: 0.7em;
    color: #666;
    margin-right: 10px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    color: var(--primary-color);
}

.quantity-input {
    width: 50px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}
