/* ============================================
   VenueHub 2026 - 新竹市研習中心場地借用系統
   主要樣式檔案
   ============================================ */

/* ============ 變數定義 ============ */
:root {
    --vh-primary: #1a5f7a;
    --vh-secondary: #57837b;
    --vh-accent: #c38154;
    --vh-light: #f5f5f5;
    --vh-dark: #2c3e50;
    --vh-success: #27ae60;
    --vh-warning: #f39c12;
    --vh-danger: #e74c3c;
    --vh-info: #3498db;
    
    --vh-gradient-primary: linear-gradient(135deg, #1a5f7a 0%, #2d8ba1 100%);
    --vh-gradient-secondary: linear-gradient(135deg, #57837b 0%, #7eb8aa 100%);
    --vh-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --vh-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --vh-border-radius: 12px;
    --vh-transition: all 0.3s ease;
}

/* ============ 全域樣式 ============ */
body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* ============ 導覽列 ============ */
.navbar-vh {
    background: var(--vh-gradient-primary) !important;
    box-shadow: var(--vh-shadow);
    padding: 0.5rem 0;
}

.navbar-vh .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.navbar-vh .nav-link {
    font-weight: 500;
    padding: 0.7rem 1rem !important;
    transition: var(--vh-transition);
    border-radius: 8px;
    margin: 0 2px;
}

.navbar-vh .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.navbar-vh .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* ============ 卡片樣式 ============ */
.card-vh {
    border: none;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    transition: var(--vh-transition);
    overflow: hidden;
}

.card-vh:hover {
    box-shadow: var(--vh-shadow-hover);
    transform: translateY(-3px);
}

.card-vh .card-header {
    background: var(--vh-gradient-primary);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
}

.card-vh .card-header h4,
.card-vh .card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* ============ 月曆樣式 ============ */
.calendar-container {
    background: white;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    overflow: hidden;
}

.calendar-header {
    background: var(--vh-gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.5rem;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vh-transition);
    cursor: pointer;
    text-decoration: none;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    background: var(--vh-dark);
    color: white;
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-table th:first-child,
.calendar-table th:last-child {
    color: #ffc107;
}

.calendar-table td {
    border: 1px solid #e9ecef;
    vertical-align: top;
    padding: 8px;
    height: 120px;
    transition: var(--vh-transition);
    position: relative;
}

.calendar-table td:hover {
    background: #f8f9fa;
}

.calendar-table td.today {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    box-shadow: inset 0 0 0 2px var(--vh-warning);
}

.calendar-table td.weekend {
    background: #fafafa;
}

.calendar-table td.other-month {
    background: #f5f5f5;
    opacity: 0.6;
}

.day-number {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-number a {
    text-decoration: none;
    color: var(--vh-primary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--vh-transition);
}

.day-number a:hover {
    background: var(--vh-primary);
    color: white;
}

/* ============ 預約項目樣式 ============ */
.booking-item {
    font-size: 0.7rem;
    padding: 4px 8px;
    margin-bottom: 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--vh-transition);
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.booking-approved {
    background: linear-gradient(135deg, var(--vh-success) 0%, #2ecc71 100%);
    color: white;
}

.booking-pending {
    background: linear-gradient(135deg, var(--vh-warning) 0%, #f1c40f 100%);
    color: #212529;
}

.booking-rejected {
    background: linear-gradient(135deg, var(--vh-danger) 0%, #c0392b 100%);
    color: white;
}

/* ============ 時段標籤 ============ */
.time-slot {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-right: 4px;
}

.time-morning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.time-afternoon {
    background: linear-gradient(135deg, #cce5ff 0%, #74b9ff 100%);
    color: #004085;
}

.time-evening {
    background: linear-gradient(135deg, #d4edda 0%, #55a669 100%);
    color: #155724;
}

.time-allday {
    background: linear-gradient(135deg, #f8d7da 0%, #e74c3c 100%);
    color: white;
}

/* ============ 場地篩選按鈕 ============ */
.venue-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 1rem;
    background: white;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    margin-bottom: 1rem;
}

.venue-filter {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--vh-transition);
    cursor: pointer;
}

.venue-filter:hover {
    border-color: var(--vh-primary);
    color: var(--vh-primary);
}

.venue-filter.active {
    background: var(--vh-gradient-primary);
    color: white;
    border-color: var(--vh-primary);
}

/* ============ 月份選擇按鈕 ============ */
.month-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.month-btn {
    min-width: 50px;
    padding: 6px 12px;
    border: 2px solid var(--vh-primary);
    background: white;
    color: var(--vh-primary);
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--vh-transition);
    text-decoration: none;
    text-align: center;
}

.month-btn:hover {
    background: var(--vh-primary);
    color: white;
}

.month-btn.active {
    background: var(--vh-gradient-primary);
    color: white;
    border-color: var(--vh-primary);
}

/* ============ 資訊面板 ============ */
.info-panel {
    background: white;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.info-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.info-panel-header i {
    font-size: 1.5rem;
    color: var(--vh-primary);
}

.info-panel-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--vh-dark);
}

/* ============ 時段說明 ============ */
.time-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.time-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

/* ============ 表格樣式 ============ */
.table-vh {
    border-radius: var(--vh-border-radius);
    overflow: hidden;
    box-shadow: var(--vh-shadow);
}

.table-vh thead {
    background: var(--vh-gradient-primary);
    color: white;
}

.table-vh thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table-vh tbody tr {
    transition: var(--vh-transition);
}

.table-vh tbody tr:hover {
    background: #f8f9fa;
}

/* ============ 按鈕樣式 ============ */
.btn-vh-primary {
    background: var(--vh-gradient-primary);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--vh-transition);
}

.btn-vh-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 95, 122, 0.3);
    color: white;
}

.btn-vh-secondary {
    background: var(--vh-gradient-secondary);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--vh-transition);
}

.btn-vh-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(87, 131, 123, 0.3);
    color: white;
}

/* ============ 表單樣式 ============ */
.form-vh {
    background: white;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    padding: 2rem;
}

.form-vh .form-label {
    font-weight: 600;
    color: var(--vh-dark);
    margin-bottom: 0.5rem;
}

.form-vh .form-control,
.form-vh .form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    transition: var(--vh-transition);
}

.form-vh .form-control:focus,
.form-vh .form-select:focus {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

/* ============ 場地卡片 ============ */
.venue-card {
    background: white;
    border-radius: var(--vh-border-radius);
    box-shadow: var(--vh-shadow);
    overflow: hidden;
    transition: var(--vh-transition);
    height: 100%;
}

.venue-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vh-shadow-hover);
}

.venue-card-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.venue-card-body {
    padding: 1.5rem;
}

.venue-card-title {
    font-weight: 700;
    color: var(--vh-primary);
    margin-bottom: 0.5rem;
}

.venue-card-capacity {
    background: var(--vh-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.venue-status-available {
    color: var(--vh-success);
    font-weight: 600;
}

.venue-status-unavailable {
    color: var(--vh-danger);
    font-weight: 600;
}

/* ============ 空場地一覽 ============ */
.available-slot {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px dashed var(--vh-success);
    border-radius: 8px;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: var(--vh-transition);
    text-align: center;
    display: block;
    text-decoration: none;
    color: var(--vh-success);
}

.available-slot:hover {
    background: var(--vh-success);
    color: white;
    border-style: solid;
    text-decoration: none;
}

/* ============ 頁尾 ============ */
.footer-vh {
    background: var(--vh-dark);
    color: #adb5bd;
    padding: 2rem 0;
}

.footer-vh a {
    color: #fff;
    text-decoration: none;
    transition: var(--vh-transition);
}

.footer-vh a:hover {
    color: var(--vh-accent);
}

/* ============ 徽章樣式 ============ */
.badge-vh {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-vh-success {
    background: var(--vh-success);
    color: white;
}

.badge-vh-warning {
    background: var(--vh-warning);
    color: #212529;
}

.badge-vh-danger {
    background: var(--vh-danger);
    color: white;
}

.badge-vh-info {
    background: var(--vh-info);
    color: white;
}

/* ============ 日曆選擇器 (借用申請用) ============ */
.date-picker-container {
    border: 2px solid #e9ecef;
    border-radius: var(--vh-border-radius);
    padding: 1rem;
    background: white;
}

.date-picker-container .ui-datepicker {
    width: 100% !important;
    border: none;
    box-shadow: none;
}

/* ============ 回應式設計 ============ */
@media (max-width: 768px) {
    .calendar-table td {
        height: 80px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 0.85rem;
    }
    
    .booking-item {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    
    .time-slot {
        display: none;
    }
    
    .venue-filter-container {
        gap: 4px;
    }
    
    .venue-filter {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .month-btn {
        min-width: 40px;
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* ============ 動畫效果 ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============ 載入狀態 ============ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
