:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
}

body.dark-mode {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-light: #cbd5e1;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--background-color);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    padding: 12px 40px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--background-color);
}

.form-group i {
    position: absolute;
    right: 12px;
    top: 40px;
    color: var(--text-light);
    pointer-events: none;
}

.login-btn {
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

#loginMessage {
    text-align: center;
    margin-top: 15px;
}

#loginMessage p {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0;
}

#loginMessage .success {
    background: #d1fae5;
    color: #065f46;
}

#loginMessage .error {
    background: #fee2e2;
    color: #991b1b;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Admin Dashboard Styles */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--surface-color);
}

.admin-sidebar {
    width: 250px;
    background: var(--background-color);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar h2 {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin: 0;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--surface-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.admin-sidebar i {
    margin-right: 12px;
    width: 20px;
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: 8px;
}

.admin-header h1 {
    margin: 0;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 8px 16px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    opacity: 0.8;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card .number {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.table-container {
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface-color);
    border-bottom: 2px solid var(--border-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--surface-color);
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.8;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--background-color);
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-content {
        margin-left: 200px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .admin-sidebar.active {
        width: 200px;
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

    .login-box {
        padding: 30px 20px;
    }
}
