/* ==========================================
   PORT777 - Complete Theme (Black & Red)
   ========================================== */

:root {
    --primary-black: #0a0a0a;
    --primary-red: #ff0033;
    --primary-white: #FFFFFF;
    --secondary-gray: #141414;
    --tertiary-gray: #262626;
    --light-gray: #F5F5F5;
    --text-dark: #0a0a0a;
    --text-light: #FFFFFF;
    --border-color: #ff0033;
    --shadow-color: rgba(255, 0, 51, 0.25);
    --bs-body-bg: #0a0a0a;
    --bs-body-color: #FFFFFF;
    --bs-primary: #ff0033;
    --bs-primary-rgb: 255, 0, 51;
    --bs-link-color: #ff4d6d;
    --bs-link-hover-color: #ff0033;
    --bs-dark: #0a0a0a;
    --bs-dark-rgb: 10, 10, 10;
    --bs-border-color: #141414;
    --bs-card-bg: #141414;
    --bs-card-border-color: #262626;
}

[data-theme="light"] {
    --primary-black: #FFFFFF;
    --primary-white: #1a1a1a;
    --secondary-gray: #f0f0f0;
    --tertiary-gray: #e0e0e0;
    --light-gray: #1a1a1a;
    --text-dark: #FFFFFF;
    --text-light: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --bs-body-bg: #FFFFFF;
    --bs-body-color: #1a1a1a;
    --bs-dark: #f8f9fa;
    --bs-dark-rgb: 248, 249, 250;
    --bs-border-color: #dee2e6;
    --bs-card-bg: #FFFFFF;
    --bs-card-border-color: #dee2e6;
}

* { scrollbar-width: thin; scrollbar-color: #ff0033 #0a0a0a; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #ff0033; border-radius: 4px; }

body {
    background-color: var(--primary-black);
    color: var(--text-light);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #0d0005 0%, #050002 100%);
    padding: 20px;
}

.particles-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particles-bg span {
    position: absolute;
    display: block;
    width: 3px; height: 3px;
    background: #ff0033;
    border-radius: 50%;
    animation: float-particle 8s infinite;
    opacity: 0.3;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.particles-bg span:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; }
.particles-bg span:nth-child(2) { left: 25%; animation-delay: 1s; animation-duration: 8s; }
.particles-bg span:nth-child(3) { left: 40%; animation-delay: 2s; animation-duration: 7s; }
.particles-bg span:nth-child(4) { left: 55%; animation-delay: 0.5s; animation-duration: 9s; }
.particles-bg span:nth-child(5) { left: 70%; animation-delay: 1.5s; animation-duration: 6.5s; }
.particles-bg span:nth-child(6) { left: 85%; animation-delay: 2.5s; animation-duration: 8.5s; }
.particles-bg span:nth-child(7) { left: 50%; animation-delay: 3s; animation-duration: 7.5s; }
.particles-bg span:nth-child(8) { left: 15%; animation-delay: 1.8s; animation-duration: 9.5s; }
.particles-bg span:nth-child(9) { left: 65%; animation-delay: 0.8s; animation-duration: 6.8s; }
.particles-bg span:nth-child(10) { left: 35%; animation-delay: 2.2s; animation-duration: 8.2s; }

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

.login-form-side {
    background: var(--secondary-gray);
    border: 2px solid var(--primary-red);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 15px 50px var(--shadow-color);
}

.login-form-side h2 { color: var(--primary-red); font-weight: 900; }
.login-form-side p { color: var(--light-gray); }

.brand-icon {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(255, 0, 51, 0.15);
    border: 2px solid var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
    color: var(--primary-red);
}

.input-group-custom { position: relative; }

.input-custom {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: var(--primary-black);
    border: 2px solid var(--tertiary-gray);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-custom:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
    font-size: 1.2rem;
}

.floating-label {
    position: absolute;
    left: 45px;
    top: -10px;
    background: var(--secondary-gray);
    padding: 0 5px;
    font-size: 0.8rem;
    color: var(--primary-red);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    border-right: 2px solid var(--primary-red);
    padding: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    background: linear-gradient(135deg, #cc0029 0%, #ff0033 100%);
    text-align: center;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #fff;
}

.sidebar-brand-icon { font-size: 2rem; color: #fff; margin-right: 10px; }

.sidebar-section-title {
    color: var(--primary-red);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 20px 20px 8px;
    margin: 0;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 0, 51, 0.15);
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

.sidebar-link i { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-user {
    padding: 15px 20px;
    border-top: 1px solid var(--secondary-gray);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
}

.sidebar-user-name { font-size: 0.9rem; font-weight: 600; }
.sidebar-user-level { font-size: 0.75rem; color: var(--light-gray); }

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 25px 30px;
    min-height: 100vh;
    transition: all 0.3s;
}

[data-theme="light"] .main-content { background: #f5f5f5; }

.page-header { margin-bottom: 25px; }

.page-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-light);
    margin: 0;
}

.page-subtitle { color: var(--light-gray); font-size: 0.9rem; margin: 5px 0 0; }

/* Stat Cards */
.stat-card-new {
    background: var(--secondary-gray);
    border: 1px solid var(--tertiary-gray);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
}

.stat-card-new:hover { border-color: var(--primary-red); box-shadow: 0 5px 20px var(--shadow-color); }

.stat-card-new h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--light-gray);
    margin: 0 0 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-light);
    margin: 0;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px;
    background: var(--secondary-gray);
    border: 1px solid var(--tertiary-gray);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    color: var(--text-light);
}

.action-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.action-btn i { font-size: 24px; }
.action-btn span { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }

/* User Info Card */
.user-info-card {
    background: var(--secondary-gray);
    border: 1px solid var(--tertiary-gray);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
}

.user-info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-red);
}

.user-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--tertiary-gray);
}

.user-info-label { color: var(--light-gray); }
.user-info-value { font-weight: 600; }

/* Cards */
.card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-card-border-color);
    border-radius: 12px;
}

.card-header {
    background: var(--primary-red);
    color: white;
    font-weight: 700;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.card-body { color: var(--text-light); }

/* Table */
.table { color: var(--text-light); margin-bottom: 0; }
.table thead th {
    background: var(--primary-black);
    color: var(--primary-red);
    border-color: var(--tertiary-gray);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
}
.table td { border-color: var(--tertiary-gray); vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(255, 0, 51, 0.08); }

/* Form elements */
.form-control, .form-select {
    background: var(--primary-black);
    border: 2px solid var(--tertiary-gray);
    color: var(--text-light);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--shadow-color);
    background: var(--primary-black);
    color: var(--text-light);
}

.form-label { color: var(--light-gray); font-weight: 600; font-size: 0.85rem; }

.form-check-input:checked { background-color: var(--primary-red); border-color: var(--primary-red); }

.form-check-label { color: var(--light-gray); }

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #cc0029, #ff0033);
    border: none;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff0033, #e6002e);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
}

.btn-outline:hover { background: var(--primary-red); color: #fff; }

/* Alerts */
.alert { border-radius: 12px; border: none; }
.alert-danger { background: rgba(255, 0, 51, 0.2); color: #ff6b7a; }
.alert-success { background: rgba(0, 139, 0, 0.2); color: #6bff6b; }
.alert-warning { background: rgba(139, 139, 0, 0.2); color: #ffff6b; }
.alert-secondary { background: var(--secondary-gray); color: var(--text-light); }

/* Badges */
.badge { border-radius: 6px; padding: 5px 10px; font-weight: 600; }
.bg-primary { background: var(--primary-red) !important; }
.bg-dark { background: var(--primary-black) !important; }
.bg-info { background: #006080 !important; }

/* Dropdown */
.dropdown-menu {
    background: var(--secondary-gray);
    border: 1px solid var(--tertiary-gray);
    border-radius: 12px;
    padding: 8px;
}

.dropdown-item {
    color: var(--text-light);
    border-radius: 8px;
    padding: 8px 15px;
}

.dropdown-item:hover { background: var(--primary-red); color: #fff; }
.dropdown-divider { border-color: var(--tertiary-gray); }

/* Modal */
.modal-content { background: var(--secondary-gray); color: var(--text-light); border: 1px solid var(--tertiary-gray); }
.modal-header { border-bottom: 1px solid var(--tertiary-gray); }
.modal-footer { border-top: 1px solid var(--tertiary-gray); }

/* SweetAlert2 */
.swal2-popup { background: var(--secondary-gray) !important; color: var(--text-light) !important; border: 1px solid var(--tertiary-gray); }
.swal2-title { color: var(--text-light) !important; }
.swal2-html-container { color: var(--light-gray) !important; }

/* Bottom Nav */
.bottom-nav {
    background: linear-gradient(180deg, var(--secondary-gray) 0%, var(--primary-black) 100%);
    border-top: 2px solid var(--primary-red);
}

.bottom-nav-item {
    color: var(--light-gray);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 11px;
    font-weight: 600;
}

.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--primary-red); }
.bottom-nav-item i { font-size: 20px; }

/* Telegram Icons */
.telegram-icons { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }
.telegram-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255, 0, 51, 0.1);
    border: 2px solid var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s;
}
.telegram-icon:hover { background: var(--primary-red); color: #fff; box-shadow: 0 0 20px var(--shadow-color); transform: translateY(-3px); }

/* Page transitions */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: slideIn 0.5s ease-out both; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 15px; }
    .quick-actions { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .action-btn { padding: 12px; }
    .action-btn i { font-size: 20px; }
    .action-btn span { font-size: 11px; }
    .page-title { font-size: 22px; }
    .login-form-side { padding: 30px 20px; }
}

@media (max-width: 480px) {
    .login-form-side { padding: 20px 15px; }
    .page-title { font-size: 18px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .user-info-row { flex-direction: column; gap: 5px; }
}

/* Light Theme overrides */
[data-theme="light"] .sidebar { background: #ffffff; border-right: 1px solid #e0e0e0; }
[data-theme="light"] .sidebar-link { color: #333; }
[data-theme="light"] .sidebar-link:hover, [data-theme="light"] .sidebar-link.active { background: #ff0033; color: #fff; }
[data-theme="light"] .sidebar-user { border-color: #e0e0e0; }
[data-theme="light"] .sidebar-section-title { color: #ff0033; }
[data-theme="light"] .page-title { color: #1a1a1a; }
[data-theme="light"] .page-subtitle { color: #666; }
[data-theme="light"] .stat-card-new, [data-theme="light"] .user-info-card { background: #ffffff; border-color: #e0e0e0; }
[data-theme="light"] .stat-card-new h3 { color: #666; }
[data-theme="light"] .stat-value { color: #1a1a1a; }
[data-theme="light"] .user-info-label { color: #888; }
[data-theme="light"] .user-info-value { color: #1a1a1a; }
[data-theme="light"] .action-btn { background: #f0f0f0; color: #333; border: 1px solid #e0e0e0; }
[data-theme="light"] .action-btn:hover { background: #ff0033; color: #fff; }
[data-theme="light"] .card { background: #ffffff; border-color: #e0e0e0; }
[data-theme="light"] .table { color: #1a1a1a; }
[data-theme="light"] .table thead th { background: #f0f0f0; color: #333; border-color: #e0e0e0; }
[data-theme="light"] .table td { border-color: #e0e0e0; }
[data-theme="light"] .table-hover tbody tr:hover { background: #f8f8f8; }
[data-theme="light"] .form-control, [data-theme="light"] .form-select { background: #fff; color: #333; border-color: #ddd; }
[data-theme="light"] .form-control:focus { border-color: #ff0033; }
[data-theme="light"] .card-header { background: #ff0033; color: #fff; }

/* DataTable */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--primary-black);
    color: var(--text-light);
    border: 1px solid var(--tertiary-gray);
    border-radius: 6px;
    padding: 4px 8px;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: var(--text-light); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-light) !important;
    border: 1px solid var(--tertiary-gray) !important;
    background: var(--secondary-gray) !important;
    border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-red) !important;
    color: #fff !important;
}

[data-theme="light"] .dataTables_wrapper .dataTables_length select,
[data-theme="light"] .dataTables_wrapper .dataTables_filter input { background: #fff; color: #333; border-color: #ddd; }
[data-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #f0f0f0 !important;
    border-color: #ddd !important;
    color: #333 !important;
}
