/**
 * ระบบจัดเก็บระเบียบวาระการประชุมประจำเดือน
 * Main Stylesheet
 */

/* ========================================
   Variables & Reset
   ======================================== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --bg-light: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

.header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* ========================================
   Search Section
   ======================================== */
.search-section {
    margin: 2rem 0;
}

.search-form {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.search-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.year-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.year-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.btn.loading:disabled {
    opacity: 0.8;
}

/* ========================================
   Stats Section
   ======================================== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ========================================
   Meeting Cards
   ======================================== */
.meetings-section {
    margin-bottom: 3rem;
}

.meeting-card {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.meeting-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.meeting-header h2 {
    flex: 1;
    margin-bottom: 0;
    color: var(--text-color);
    font-size: 1.25rem;
}

.meeting-number {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.meeting-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.info-item i {
    color: var(--primary-color);
}

.meeting-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.meeting-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.attachment-badge.pdf {
    background-color: #fee2e2;
    color: #dc2626;
}

.attachment-badge.image {
    background-color: #dbeafe;
    color: #2563eb;
}

.attachment-badge.video {
    background-color: #fef3c7;
    color: #d97706;
}

.meeting-actions {
    display: flex;
    gap: 0.75rem;
}

/* ========================================
   Meeting Detail
   ======================================== */
.breadcrumb {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meeting-detail {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.detail-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.detail-header h1 {
    margin-bottom: 1rem;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-box {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.info-box i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.info-box strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.info-box p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.description-content {
    line-height: 1.8;
    color: var(--text-muted);
}

.attachments-grid {
    display: grid;
    gap: 1rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.attachment-item i {
    font-size: 2rem;
    color: var(--danger-color);
}

.attachment-info {
    flex: 1;
}

.attachment-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.attachment-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: var(--radius-md);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   No Results
   ======================================== */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer a:hover {
    color: var(--primary-color);
}

/* ========================================
   Admin Styles
   ======================================== */
.admin-page {
    background: var(--bg-color);
    min-height: 100vh;
}

.admin-nav {
    background: white;
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.admin-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

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

.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.admin-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.admin-menu {
    list-style: none;
}

.admin-menu li {
    margin-bottom: 0.5rem;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-color);
    transition: var(--transition);
}

.admin-menu a:hover,
.admin-menu li.active a {
    background-color: var(--primary-color);
    color: white;
}

.admin-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-form-inline {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.search-form-inline .search-input {
    flex: 1;
    min-width: 200px;
}

.status-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Admin Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table thead {
    background-color: var(--bg-color);
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tbody tr:hover {
    background-color: var(--bg-color);
}

.text-center {
    text-align: center !important;
}

.text-muted {
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fed7aa;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Admin Form */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-form {
    margin-top: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Drag-and-drop file upload zones */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: #f8fafc;
    user-select: none;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: #e0f2fe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.drop-zone-content {
    pointer-events: auto;
    user-select: none;
    text-align: center;
    padding: 2rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.drop-zone-content:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    transform: translateY(-1px);
}

.drop-zone-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.drop-zone-content p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.click-to-browse {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: none;
    transition: var(--transition);
}

.click-to-browse:hover {
    color: var(--primary-dark);
}

.file-drop-zone small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-preview-list {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    pointer-events: none; /* Prevent parent click events from bubbling */
}

.file-preview-list .file-preview-item {
    pointer-events: auto; /* Re-enable pointer events for preview items */
}

.file-preview-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 120px;
    font-size: 0.75rem;
    text-align: center;
    word-break: break-word;
    overflow: hidden;
}

.file-preview-item.pdf {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    justify-content: center;
    padding: 0.5rem;
}

.file-preview-item.image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.file-preview-item.image::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    pointer-events: none;
}

.file-preview-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.file-preview-item .file-name {
    position: relative;
    z-index: 2;
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0,0,0,0.6);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: calc(100% - 1rem);
    font-size: 0.7rem;
}

.file-preview-item.pdf .file-name {
    color: var(--text-color);
    background: transparent;
    text-shadow: none;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 11px;
    font-weight: 700;
    box-shadow: 
        0 3px 12px rgba(255, 65, 108, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(255, 255, 255, 1);
    opacity: 1;
}

.file-preview-item .remove-file:hover {
    background: linear-gradient(135deg, #ff3057 0%, #ff2a13 100%);
    transform: scale(1.2);
    box-shadow: 
        0 5px 20px rgba(255, 65, 108, 0.7),
        0 3px 8px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(255, 255, 255, 1),
        0 0 12px rgba(255, 65, 108, 0.4);
    opacity: 1;
}

.file-preview-item .remove-file:active {
    transform: scale(1);
    transition: all 0.1s ease;
    box-shadow: 
        0 2px 8px rgba(255, 65, 108, 0.8),
        0 0 0 2px rgba(255, 255, 255, 1);
}

.file-preview-item .remove-file i {
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.2s ease;
}

.file-preview-item .remove-file:hover i {
    transform: rotate(90deg) scale(1.1);
}

/* Always visible remove button */
.file-preview-item {
    position: relative;
}

.file-preview-item .remove-file {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.file-preview-item:hover .remove-file {
    opacity: 1;
    transform: scale(1.1);
}
 

/* Remove backdrop overlay - keep button clearly visible */
.file-preview-item .remove-file {
    z-index: 100;
}

/* Responsive sizing */
@media (max-width: 768px) {
    .file-preview-item .remove-file {
        width: 30px;
        height: 30px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }
    
    .file-preview-item .remove-file i {
        font-size: 11px;
    }
}

.required {
    color: var(--danger-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Current Attachments in Edit Form */
.current-attachments {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.current-attachments h3 {
    margin-bottom: 1rem;
}

.attachments-list {
    display: grid;
    gap: 0.75rem;
}

.attachment-item-edit {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.attachment-item-edit i {
    font-size: 1.5rem;
    color: var(--text-muted); /* use muted color for file-type icon to keep UI neutral */
}

.attachment-item-edit span {
    flex: 1;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-delete-file {
    color: var(--text-color);
    background: transparent;
    border: none;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
    cursor: pointer; /* show hand cursor */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-file:hover {
    background-color: rgba(0,0,0,0.06); /* subtle hover */
    color: var(--danger-color); /* icon turns warning color on hover */
    transform: translateY(-1px);
}

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

/* Alerts */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.alert.auto-hide {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 20000;
    margin-bottom: 0;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.alert i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background-color: #dbeafe;
    color: #0c4a6e;
    border: 1px solid #7dd3fc;
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    text-align: center;
}

.login-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}



/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .search-group {
        flex-direction: column;
    }
    
    .search-input,
    .year-select {
        width: 100%;
    }
    
    .meeting-header {
        flex-direction: column;
    }
    
    .meeting-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        position: static;
    }
    
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form-inline {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 0.875rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .meeting-attachments {
        flex-direction: column;
    }
    
    .meeting-actions {
        flex-direction: column;
    }
    
    .pagination {
        flex-direction: column;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Lightbox / Image Slideshow
   ======================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.3s ease;
    overflow: hidden;
    position: relative;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

.lightbox-image-container img.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

.lightbox-image-container.dragging img {
    cursor: grabbing !important;
}

/* Zoom animation */
@keyframes zoomInImage {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(2);
    }
}

/* Smooth transitions */
.lightbox-image-container img {
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

/* Loading state */
.lightbox-image-container::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox-image-container.loading::before {
    opacity: 1;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-download,
.lightbox-zoom {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-download:hover,
.lightbox-zoom:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-download {
    top: 20px;
    right: 80px;
}

.lightbox-zoom {
    top: 20px;
    right: 140px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 90%;
    animation: slideUp 0.3s ease;
}

#lightbox-title {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#lightbox-counter {
    display: block;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Zoom level indicator */
.zoom-indicator {
    position: absolute;
    top: 85px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.zoom-indicator.show {
    opacity: 1;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    top: 85px;
    right: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10001;
}

.zoom-btn-control {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.zoom-btn-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.zoom-btn-control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.zoom-reset {
    font-size: 0.75rem;
    height: 32px;
}

.missing-file,
.missing-image .placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.missing-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}

.missing-image .placeholder {
    padding: 2rem;
}

/* Lightbox Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Lightbox Responsive */
@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-download {
        top: 10px;
        right: 60px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-zoom {
        top: 60px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .zoom-controls {
        top: 60px;
        right: 60px;
    }
    
    .zoom-btn-control {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .zoom-indicator {
        top: 110px;
        right: 10px;
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .lightbox-caption {
        bottom: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 95%;
    max-height: 90vh;
    overflow: visible;
    animation: slideUp 0.3s ease-out;
    z-index: 10000;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.warning-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem auto;
}

.meeting-title {
    font-size: 1.1rem;
    color: #059669 !important;
    font-weight: 600;
    margin: 1.5rem 0 !important;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    text-align: center;
    word-break: break-word;
}

.warning-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #92400e;
    border: 1px solid #fde68a;
    margin-top: 1.5rem;
    text-align: left;
}

.warning-note i {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: #f9fafb;
}

.modal-footer .btn {
    min-width: 120px;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Button Loading States
   ======================================== */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Form submission feedback */
.form-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
}

.form-feedback.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-feedback.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-feedback.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

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