/**
 * ระบบจองห้องประชุมออนไลน์
 * Meeting Room Booking System - Global Styles
 * @charset UTF-8
 */

/* ====================================================
   Global Styles & Typography
   ==================================================== */

* {
    font-family: 'Sarabun', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f5dc 0%, #e8dcc4 100%);
    min-height: 100vh;
    padding-bottom: 2rem;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* ====================================================
   Header Styles
   ==================================================== */

.header-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
    overflow: hidden;
}

.header-top {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.system-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.current-datetime {
    font-size: 1rem;
    opacity: 0.95;
    margin-top: 0.5rem;
}

.header-content {
    padding: 1.5rem 2rem;
}

/* ====================================================
   User Info Section
   ==================================================== */

.user-info-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-details h5 {
    margin: 0;
    font-weight: 600;
    color: #2d3748;
}

.user-meta {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 0.25rem;
}

.badge-role {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
}

/* ====================================================
   Login Form Styles
   ==================================================== */

.login-form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
}

.login-form-inline .form-group {
    margin-bottom: 0;
}

.login-form-inline label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.login-form-inline input {
    min-width: 200px;
}

/* ====================================================
   Card Styles
   ==================================================== */

.calendar-card,
.content-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 2rem;
    margin-bottom: 2rem;
}

.calendar-header,
.card-header-custom {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.calendar-title,
.card-title-custom {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* ====================================================
   Timeline & Booking Styles
   ==================================================== */

.timeline-container {
    position: relative;
}

.time-slot {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    min-height: 60px;
    position: relative;
}

.time-slot:last-child {
    border-bottom: none;
}

.time-label {
    width: 80px;
    padding: 0.75rem;
    font-weight: 500;
    color: #718096;
    border-right: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.time-content {
    flex: 1;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
}

.booking-item {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.booking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.booking-room {
    font-weight: 600;
    font-size: 0.95rem;
}

.booking-purpose {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.booking-booker {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.no-bookings {
    padding: 3rem;
    text-align: center;
    color: #a0aec0;
}

.no-bookings i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ====================================================
   Button Styles
   ==================================================== */

.btn-gradient {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    border: none;
    color: white;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
    color: white;
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-outline-gradient {
    border: 2px solid #c89d6a;
    color: #c89d6a;
    background: white;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline-gradient:hover {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    color: white;
    border-color: transparent;
}

/* ====================================================
   Form Styles
   ==================================================== */

.form-control:focus {
    border-color: #c89d6a;
    box-shadow: 0 0 0 0.25rem rgba(212, 165, 116, 0.25);
}

.form-select:focus {
    border-color: #c89d6a;
    box-shadow: 0 0 0 0.25rem rgba(212, 165, 116, 0.25);
}

.form-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: #718096;
}

/* ====================================================
   Alert Styles
   ==================================================== */

.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

/* ====================================================
   Badge Styles
   ==================================================== */

.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.badge-status-confirmed {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.badge-status-cancelled {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.badge-status-pending {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

/* ====================================================
   Table Styles
   ==================================================== */

.table-custom {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table-custom thead {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    color: white;
}

.table-custom thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table-custom tbody tr {
    transition: background-color 0.2s;
}

.table-custom tbody tr:hover {
    background-color: #f7fafc;
}

.table-custom tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* ====================================================
   Modal Styles
   ==================================================== */

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
}

/* ====================================================
   Loading Spinner
   ==================================================== */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-custom {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================================
   Utility Classes
   ==================================================== */

.text-gradient {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-custom {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.shadow-custom-sm {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rounded-custom {
    border-radius: 15px;
}

/* ====================================================
   Responsive Design
   ==================================================== */

@media (max-width: 768px) {
    .main-container {
        padding: 0.5rem;
    }

    .header-top {
        padding: 1rem;
    }

    .system-title {
        font-size: 1.3rem;
    }

    .current-datetime {
        font-size: 0.85rem;
    }

    .header-content {
        padding: 1rem;
    }

    .user-info-section {
        flex-direction: column;
        text-align: center;
    }

    .login-form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .login-form-inline input {
        min-width: 100%;
    }

    .time-label {
        width: 60px;
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .time-content {
        grid-template-columns: 1fr;
    }

    .calendar-card,
    .content-card {
        padding: 1rem;
    }

    .calendar-title,
    .card-title-custom {
        font-size: 1.2rem;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .system-title {
        font-size: 1.1rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .booking-item {
        padding: 0.5rem;
    }

    .booking-room {
        font-size: 0.85rem;
    }

    .booking-purpose,
    .booking-booker {
        font-size: 0.75rem;
    }
}

/* ====================================================
   Print Styles
   ==================================================== */

@media print {
    body {
        background: white;
    }

    .header-top {
        background: #c89d6a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .btn,
    .login-form-inline {
        display: none !important;
    }

    .booking-item {
        background: #c89d6a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .shadow-custom,
    .shadow-custom-sm {
        box-shadow: none !important;
    }
}

/* ====================================================
   Animation Classes
   ==================================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====================================================
   Custom Scrollbar
   ==================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #d4a574 0%, #c89d6a 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c89d6a 0%, #b8895f 100%);
}

/* ====================================================
   Department Management Styles
   ==================================================== */

.table-actions {
    white-space: nowrap;
}

.dept-count-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}
