:root {
    --color-dark: #0a0a0f;
    --color-primary: #e63946;
    --color-accent: #f4a261;
    --color-light: #f1faee;
    --color-mid: #a8dadc;
    --color-purple: #6a4c93;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--color-dark);
    color: var(--color-light);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    position: relative;
    padding: 2rem;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(106, 76, 147, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
}

.login-header p {
    color: var(--color-accent);
    font-size: 1.1rem;
}

.login-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-light);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(241, 250, 238, 0.2);
    border-radius: 8px;
    color: var(--color-light);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Custom Checkbox Styling */
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--color-primary);
    transform: scale(1.2);
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-light);
}

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

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

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

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--color-danger);
    color: #ff7675;
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--color-success);
    color: #55efc4;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid var(--color-warning);
    color: #feca57;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--color-primary);
}

.login-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid var(--color-warning);
    border-radius: 10px;
    text-align: center;
}

.login-info .small {
    font-size: 0.85rem;
    color: rgba(241, 250, 238, 0.6);
    margin-top: 0.5rem;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(10, 10, 15, 0.95);
    border-right: 1px solid rgba(230, 57, 70, 0.2);
    padding: 2rem 0;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(230, 57, 70, 0.2);
}

.sidebar-header h2 {
    color: var(--color-primary);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--color-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(230, 57, 70, 0.1);
    border-left-color: var(--color-primary);
    color: var(--color-primary);
}

/* Submenu Styles */
.sidebar-nav li.has-submenu {
    position: relative;
}

.sidebar-nav .submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-nav .submenu-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.sidebar-nav li.has-submenu.open .submenu-arrow {
    transform: rotate(-180deg);
}

.sidebar-nav .submenu {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav li.has-submenu.open .submenu {
    max-height: 200px;
}

.sidebar-nav .submenu li a {
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar-nav .submenu li a:hover {
    background: rgba(230, 57, 70, 0.08);
    border-left-color: var(--color-accent);
    color: var(--color-accent);
}

/* Tabs */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid rgba(230, 57, 70, 0.2);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: none;
    color: rgba(241, 250, 238, 0.7);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--color-accent);
    background: rgba(230, 57, 70, 0.05);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.main-content {
    padding: 2rem;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(230, 57, 70, 0.2);
}

.content-header h1 {
    font-size: 2rem;
    color: var(--color-light);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(230, 57, 70, 0.2);
}

.card-header h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(241, 250, 238, 0.1);
}

table th {
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

table td {
    color: var(--color-light);
}

table tr:hover {
    background: rgba(230, 57, 70, 0.05);
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: var(--color-success);
    color: white;
}

.badge-danger {
    background: var(--color-danger);
    color: white;
}

.badge-warning {
    background: var(--color-warning);
    color: white;
}

.badge-rank-1 {
    background: #95a5a6;
    color: white;
}

.badge-rank-2 {
    background: #3498db;
    color: white;
}

.badge-rank-3 {
    background: #9b59b6;
    color: white;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-dark);
    border: 2px solid var(--color-primary);
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(230, 57, 70, 0.2);
}

.modal-header h2 {
    color: var(--color-primary);
    font-size: 1.8rem;
}

.modal-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
    background: var(--color-danger);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.6);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(5px);
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        padding: 5rem 1.5rem 2rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-wrap: wrap;
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
        min-width: 120px;
    }

    .card {
        padding: 1.5rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .login-box {
        padding: 2rem 1.5rem;
    }

    .login-header h1 {
        font-size: 2rem;
    }

    /* Submenu on mobile */
    .sidebar .submenu li a {
        padding: 0.6rem 1.5rem 0.6rem 2rem;
        font-size: 0.85rem;
    }

    /* Tabs on mobile */
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 0.75rem;
        left: 0.75rem;
    }

    .mobile-menu-toggle span {
        width: 22px;
    }

    .sidebar {
        width: 250px;
        left: -270px;
    }

    .main-content {
        padding: 4.5rem 1rem 1.5rem;
    }

    .content-header h1 {
        font-size: 1.3rem;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    .login-box {
        padding: 1.5rem 1rem;
    }

    .login-header h1 {
        font-size: 1.8rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}