/* 
 * CSS สำหรับระบบโฮมรูมออนไลน์ โรงเรียนละลมวิทยา
 * ใช้ร่วมกับ Tailwind CSS
 */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
}

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

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* สไตล์หน้า Login */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* สไตล์ Header */
.header-bar {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* สไตล์ Card */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* สไตล์ฟอร์ม */
.form-input {
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* สไตล์ปุ่ม */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* สไตล์ตาราง */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table-custom th {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table-custom td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-custom tr:hover {
    background: #f8fafc;
}

/* สไตล์ Radio Button สำหรับเช็คชื่อ */
.radio-attendance {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-attendance:checked + label {
    font-weight: 600;
    color: var(--primary-color);
}

/* สไตล์ Alert */
.alert-success {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* สไตล์สำหรับการอัปโหลดไฟล์ */
.file-upload {
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

/* สไตล์สำหรับ Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* สไตล์สำหรับ Responsive */
@media (max-width: 768px) {
    .container-mobile {
        padding: 0.5rem;
    }
    
    .table-custom {
        font-size: 0.875rem;
    }
    
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* สไตล์สำหรับ Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* สไตล์สำหรับ Sidebar */
.sidebar {
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

.sidebar-item {
    padding: 1rem;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-item:hover {
    background: #f8fafc;
    border-left-color: var(--primary-color);
}

.sidebar-item.active {
    background: #eff6ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}
