/* =====================================================
   Training Registration System - Main Stylesheet
   ===================================================== */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

/* =====================================================
   Frontend Styles
   ===================================================== */

.training-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
}

.training-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

/* Month Section */
.month-section {
    margin-bottom: 40px;
}

.month-title {
    color: #0077b6;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0077b6;
}

/* Training Table */
.training-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.training-table th {
    background: #f8f9fa;
    color: var(--text-color);
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.training-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.training-table tr:hover {
    background-color: #f8f9fa;
}

.training-table tr:last-child td {
    border-bottom: none;
}

/* Course Name */
.course-name {
    font-weight: 500;
    color: var(--text-color);
}

/* Instructor */
.instructor-name {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Price */
.price {
    font-weight: 500;
    color: var(--text-color);
}

.vat-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Available Seats Badge */
.seats-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.seats-badge.available {
    background: #d4edda;
    color: #155724;
}

.seats-badge.limited {
    background: #fff3cd;
    color: #856404;
}

.seats-badge.full {
    background: #f8d7da;
    color: #721c24;
}

/* Register Button */
.btn-register {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-register:hover {
    background: linear-gradient(135deg, #005f8a 0%, #0096b4 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,119,182,0.3);
}

.btn-register.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =====================================================
   Registration Form Modal
   ===================================================== */

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 20px 25px;
}

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

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

.modal-body {
    padding: 30px;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 5px;
}

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

.form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.course-info-box {
    background: #e7f5ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.course-info-box h5 {
    color: #0077b6;
    margin-bottom: 10px;
}

.course-info-box p {
    margin-bottom: 5px;
    color: var(--text-color);
}

/* =====================================================
   Success Message
   ===================================================== */

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon i {
    font-size: 40px;
    color: var(--success-color);
}

.success-message h4 {
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-message p {
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* =====================================================
   Admin Styles
   ===================================================== */

.admin-sidebar {
    background: #2c3e50;
    min-height: 100vh;
    padding-top: 20px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 5px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-sidebar .nav-link i {
    width: 25px;
}

.admin-content {
    padding: 30px;
    background: var(--light-bg);
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    margin: -30px -30px 30px -30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stats-card .number {
    font-size: 2rem;
    font-weight: 700;
}

.stats-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Data Table */
.data-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.data-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    padding: 15px;
}

.data-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Action Buttons */
.btn-action {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
}

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

@media (max-width: 768px) {
    .training-table {
        display: block;
        overflow-x: auto;
    }
    
    .training-header h1 {
        font-size: 1.8rem;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* =====================================================
   Utilities
   ===================================================== */

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
