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

:root {
    /* Color Palette: Gray, Yellow, White */
    --primary-yellow: #FFC107;
    --primary-yellow-hover: #FFB300;
    --secondary-gray: #424242;
    --light-gray: #F5F5F5;
    --dark-gray: #212121;
    --white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #757575;
    --border-color: #E0E0E0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.text-center { text-align: center; }
.text-yellow { color: var(--primary-yellow); }
.text-gray { color: var(--secondary-gray); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-yellow);
    color: var(--dark-gray);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

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

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

.btn-secondary:hover {
    background-color: var(--dark-gray);
    transform: translateY(-2px);
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-gray);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-nav {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-nav a {
    text-decoration: none;
    color: var(--secondary-gray);
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--primary-yellow);
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    text-align: center;
}
.sidebar-header h2 {
    color: var(--primary-yellow);
    margin: 0;
    font-size: 1.5rem;
}
.sidebar-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav-item {
    padding: 12px 20px;
    color: var(--light-gray);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav-item:hover, .sidebar-nav-item.active {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--primary-yellow);
    border-left: 4px solid var(--primary-yellow);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--light-gray);
    display: flex;
    flex-direction: column;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--dark-gray);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,193,7,0.1) 0%, rgba(33,33,33,1) 50%);
    z-index: 0;
}

.login-box {
    background-color: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    z-index: 1;
    text-align: center;
}

.login-logo {
    font-size: 2.5rem;
    color: var(--primary-yellow);
    margin-bottom: 10px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 5px solid var(--primary-yellow);
}

.stat-info h3 {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin: 5px 0 0;
}

.stat-icon {
    font-size: 3rem;
    color: rgba(255, 193, 7, 0.3);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: var(--white);
}

.table th, .table td {
    padding: 12px 15px;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background-color: rgba(0,0,0,0.02);
    color: var(--secondary-gray);
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,0.015);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}
.modal-content {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    margin: 10vh auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.close-modal:hover {
    color: var(--dark-gray);
}

/* Footer */
.global-footer {
    margin-top: auto;
    background-color: var(--dark-gray);
    color: #ccc;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    width: 100%;
}

.admin-global-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        padding: 10px 0;
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    .sidebar-header {
        width: 100%;
        border-bottom: none;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .sidebar-nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .sidebar-nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--primary-yellow);
    }
}
