/* ไฟล์ CSS สำหรับระบบ OIT การเปิดเผยข้อมูล */
/* โรงเรียนสายธรรมจันทร์ จังหวัดราชบุรี */

/* ตัวแปรสีหลัก */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --border-color: #e5e7eb;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-success: linear-gradient(90deg, var(--success-color), var(--secondary-color));
}

/* การตั้งค่าพื้นฐาน */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
}

/* Header Section */
.header-section {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-section .container {
    position: relative;
    z-index: 1;
}

.header-section h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-section .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Cards */
.card {
    border: none;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.card-body {
    padding: 1.5rem;
}

/* Info Items */
.info-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: background-color 0.2s ease;
}

.info-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-value {
    color: var(--text-dark);
    line-height: 1.6;
}

.info-value p {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.status-complete {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-complete:hover {
    background-color: #bbf7d0;
    transform: scale(1.05);
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-pending:hover {
    background-color: #fde68a;
    transform: scale(1.05);
}

.status-incomplete {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-incomplete:hover {
    background-color: #fecaca;
    transform: scale(1.05);
}

/* Buttons */
.btn-back {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-outline-secondary {
    border-color: var(--text-light);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--text-light);
    border-color: var(--text-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Progress Section */
.progress-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.progress-section h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.progress-item:hover {
    background: white;
    box-shadow: var(--shadow-light);
    transform: translateX(5px);
}

.progress-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 120px;
}

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background-color: var(--border-color);
    overflow: hidden;
    flex: 1;
    margin: 0 1rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-success);
    transition: width 0.8s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Footer */
.footer-section {
    background: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    position: relative;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.footer-section h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-section p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-section {
        padding: 2rem 0;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .progress-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .progress-bar {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .info-item {
        padding: 0.75rem 0;
    }
    
    .btn-back {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .header-section h1 {
        font-size: 1.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .progress-section {
        padding: 1rem;
    }
    
    .status-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .header-section {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: black !important;
    }
    
    .btn-back,
    .btn-outline-primary,
    .btn-outline-secondary {
        display: none !important;
    }
    
    .progress-fill::after {
        display: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.btn-back:focus,
.btn-outline-primary:focus,
.btn-outline-secondary:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.card:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #0000ff;
        --text-dark: #000000;
        --text-light: #333333;
        --border-color: #000000;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
    
    .status-badge {
        border: 2px solid currentColor;
    }
}

/* Search and Filter Section */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.search-section .input-group-text {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.search-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.search-section .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Dark Mode */
.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

.dark-mode .card {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark-mode .card-header {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

.dark-mode .progress-section,
.dark-mode .search-section {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #404040;
    border-color: #555555;
    color: #ffffff;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #404040;
    border-color: var(--primary-color);
    color: #ffffff;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    color: white;
}

.scroll-to-top.show {
    display: flex;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .search-section .btn-group {
        flex-direction: column;
    }
    
    .search-section .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Section Header */
.section-header {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.section-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Indicator Title */
.indicator-title {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Indicator Subtitle */
.indicator-subtitle {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    color: white;
}

.indicator-subtitle .badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #1e3a8a !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Item Title Link */
.item-title-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.item-title-link:hover {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--secondary-color);
    transform: translateX(3px);
}

.item-title-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Item Title Disabled (ไม่มีไฟล์) */
.item-title-disabled {
    color: var(--text-light);
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.7;
} 