/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

/* Theme */
body.light { background: #f0f2f5; color: #333; }
body.dark { background: #1a1a2e; color: #e0e0e0; }

/* Header */
header {
    background: linear-gradient(90deg, #6C63FF, #3F3D56);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}
nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
nav a:hover { color: #FFD700; }
#theme-toggle {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: #FFD700;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s, background 0.3s;
}
#theme-toggle:hover { transform: scale(1.05); background: #FFC107; }

/* Admin Index */
.admin-index {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #6C63FF, #3F3D56);
    padding: 2rem;
    text-align: center;
}
.index-header h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1.5rem;
    animation: fadeInDown 1s ease;
}
.index-header p {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease 0.3s backwards;
}
.btn-primary {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: #FFD700;
    color: #333;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeInUp 1s ease 0.6s backwards;
}
.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
.quick-stats {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
}
.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    color: white;
}
.stat-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #FFD700;
}
.stat-item p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Admin Dashboard */
.dashboard {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.dashboard-header h1 {
    font-size: 2.5rem;
    color: #6C63FF;
    margin-bottom: 1rem;
}
.dashboard-header p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}
.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}
.stat-card:hover {
    transform: translateY(-5px);
}
.stat-card i {
    font-size: 2.5rem;
    color: #6C63FF;
    margin-bottom: 1rem;
}
.stat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.stat-card p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
body.dark .dashboard-header h1 { color: #FFD700; }
body.dark .dashboard-header p { color: #bbb; }
body.dark .stat-card { background: #33334d; }
body.dark .stat-card p { color: #e0e0e0; }
body.dark .stat-card i { color: #FFD700; }
body.dark .chart-container { background: #33334d; }

/* Hero Section (Index chung) */
.hero {
    background: linear-gradient(135deg, #6C63FF, #3F3D56);
    padding: 8rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(30deg);
    pointer-events: none;
}
.hero-content {
    max-width: 800px;
    margin: 0 auto;
}
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInDown 1s ease;
}
.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease 0.3s backwards;
}
body.dark .btn-primary { background: #FFC107; color: #1a1a2e; }

/* Features Section (Index chung) */
.features {
    padding: 5rem 2rem;
    text-align: center;
    background: #fff;
    max-width: 1200px;
    margin: 0 auto;
}
.features h2 {
    font-size: 2.5rem;
    color: #6C63FF;
    margin-bottom: 3rem;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.feature-card {
    background: #f9f9f9;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.feature-card i {
    font-size: 3rem;
    color: #6C63FF;
    margin-bottom: 1.5rem;
}
.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: #333;
}
.feature-card p {
    color: #777;
    font-size: 1rem;
}
body.dark .features { background: #2a2a40; }
body.dark .feature-card { background: #33334d; }
body.dark .feature-card h3 { color: #e0e0e0; }
body.dark .feature-card p { color: #bbb; }
body.dark .feature-card i { color: #FFD700; }

/* Login Section */
.login-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #6C63FF, #3F3D56);
    padding: 2rem;
}
.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.login-container h1 {
    font-size: 2.5rem;
    color: #6C63FF;
    margin-bottom: 1rem;
}
.login-container p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}
.error-message {
    background: #ff4d4d;
    color: white;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}
.login-form .input-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.login-form .input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6C63FF;
    font-size: 1.2rem;
}
.login-form input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
.login-form input:focus {
    border-color: #6C63FF;
}
.btn-login {
    width: 100%;
    padding: 1rem;
    background: #6C63FF;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}
.btn-login:hover {
    transform: translateY(-3px);
    background: #5A54D9;
}
.signup-link {
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}
.signup-link a {
    color: #6C63FF;
    text-decoration: none;
    font-weight: 500;
}
.signup-link a:hover { text-decoration: underline; }
body.dark .login-container {
    background: rgba(40, 40, 60, 0.95);
    color: #e0e0e0;
}
body.dark .login-container h1 { color: #FFD700; }
body.dark .login-container p { color: #bbb; }
body.dark .login-form input { border-color: #555; background: #333; color: #e0e0e0; }
body.dark .login-form input:focus { border-color: #FFD700; }
body.dark .btn-login { background: #FFD700; color: #333; }
body.dark .btn-login:hover { background: #FFC107; }

/* Footer */
footer {
    background: linear-gradient(90deg, #6C63FF, #3F3D56);
    color: white;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Animation */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .index-header h1, .hero-content h1 { font-size: 2.5rem; }
    .index-header p, .hero-content p { font-size: 1.1rem; }
    .btn-primary { padding: 1rem 2rem; font-size: 1rem; }
    .dashboard-header h1 { font-size: 2rem; }
}