:root {
    --ninja-green-dark: #0a0e0c;
    --ninja-orange: #fb8500;
    --ninja-orange-glow: #ffb703;
    --ninja-border: rgba(255, 183, 3, 0.25);
    --ninja-glass: rgba(13, 18, 15, 0.82);
}

/* Konoha Midnight Background - Slower, Darker Gradient */
body.naruto-theme {
    background: linear-gradient(-45deg, #2d0a0a, #1a1a2e, #0a1a13, #2d0a0a) !important;
    background-size: 400% 400% !important;
    animation: gradientBG 30s ease infinite !important;
    background-attachment: fixed !important;
    color: #e9ecef;
    font-family: 'Be Vietnam Pro', sans-serif;
    letter-spacing: 0.2px;
}

/* Ultra-subtle Village Overlay */
body.naruto-theme::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/naruto-bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    filter: grayscale(100%) brightness(50%);
}

/* Glassmorphism Sidebar Nav - Clean & Thin */
.naruto-sidebar {
    background: rgba(8, 12, 10, 0.9) !important;
    /* Slightly darker for better visibility */
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--ninja-border);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    height: 100vh;
}

.naruto-sidebar .sidebar-nav {
    padding-top: 40px;
}

.naruto-sidebar .sidebar-link {
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 6px 18px;
    padding: 12px 15px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.naruto-sidebar .sidebar-link:hover,
.naruto-sidebar .sidebar-link.active {
    background: rgba(251, 133, 0, 0.1) !important;
    color: var(--ninja-orange-glow) !important;
    border: 1px solid var(--ninja-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(5px);
}

.naruto-sidebar .sidebar-link .icon-wrapper {
    color: var(--ninja-orange-glow);
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.naruto-sidebar .sidebar-link:hover .icon-wrapper,
.naruto-sidebar .sidebar-link.active .icon-wrapper {
    color: #000;
}

/* Global Contrast Overrides - Fixed Dark on Dark issues */
.naruto-theme h1,
.naruto-theme h2,
.naruto-theme h3,
.naruto-theme h4,
.naruto-theme h5,
.naruto-theme h6,
.naruto-theme p,
.naruto-theme label,
.naruto-theme span:not(.badge),
.naruto-theme div:not(.badge) {
    color: #e9ecef;
    /* Light gray text by default */
}

.naruto-theme .text-dark {
    color: #f8f9fa !important;
}

.naruto-theme .text-muted {
    color: #adb5bd !important;
}

.naruto-theme .text-primary {
    color: var(--ninja-orange-glow) !important;
}

/* Table Readability */
.naruto-theme table,
.naruto-theme .table {
    color: #f8f9fa !important;
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--ninja-border);
}

.naruto-theme .table thead th {
    background: rgba(251, 133, 0, 0.1);
    color: var(--ninja-orange-glow);
    border-bottom: 2px solid var(--ninja-border);
}

/* Recharge Page Specifics & Bootstrap Logic Fixes */
.naruto-theme .bg-light-primary,
.naruto-theme .bg-light-info,
.naruto-theme .bg-light-warning,
.naruto-theme .bg-light-success,
.naruto-theme .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--ninja-border) !important;
}

.naruto-theme .notify,
.naruto-theme .alert {
    background-color: rgba(251, 133, 0, 0.1) !important;
    border: 1px solid var(--ninja-border) !important;
    color: #fff !important;
}

.naruto-theme .notify b,
.naruto-theme .notify strong {
    color: var(--ninja-orange-glow) !important;
}

/* Fix Tab Nav for Recharge */
.naruto-theme .user-profile-tab .nav-link {
    color: rgba(255, 255, 255, 0.6) !important;
    border-bottom: 2px solid transparent !important;
}

.naruto-theme .user-profile-tab .nav-link.active {
    color: var(--ninja-orange-glow) !important;
    border-bottom: 2px solid var(--ninja-orange) !important;
    background: rgba(251, 133, 0, 0.05) !important;
}

/* Modal Table Thead Fix */
.naruto-theme .table thead.bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Card Header Fix in Recharge */
.naruto-theme .card-header.bg-light-primary {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid var(--ninja-border);
}

/* Success/Warning text on dark */
.naruto-theme .text-success {
    color: #2ecc71 !important;
}

.naruto-theme .text-warning {
    color: #f1c40f !important;
}

.naruto-theme .text-danger {
    color: #e74c3c !important;
}

.naruto-theme .text-info {
    color: #3498db !important;
}

/* QR Countdown timer visibility */
.naruto-theme #countdownTimer {
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Social Ninja Section (Cộng đồng) */
.ninja-post-creator {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ninja-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ninja-post {
    background: var(--ninja-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ninja-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.ninja-post:hover {
    border-color: rgba(251, 133, 0, 0.4);
}

.ninja-comment-section {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ninja-comment {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ninja-comment:last-child {
    border-bottom: none;
}

.ninja-input {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #fff !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ninja-input:focus {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: var(--ninja-orange-glow) !important;
}

.ninja-action-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.ninja-action-link:hover {
    color: #fff;
    transform: translateY(-2px);
}

.ninja-action-link.active {
    color: #ff4e50;
    /* Heart Red */
}

.ninja-action-link.active i {
    filter: drop-shadow(0 0 5px rgba(255, 78, 80, 0.5));
}

.bg-black-20 {
    background: rgba(0, 0, 0, 0.2) !important;
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8) !important;
}

.text-muted-light {
    color: rgba(255, 255, 255, 0.4) !important;
}

.text-danger-soft {
    color: rgba(231, 76, 60, 0.7) !important;
}

.text-danger-soft:hover {
    color: #e74c3c !important;
}

.border-orange {
    border: 2px solid var(--ninja-orange) !important;
    padding: 2px;
    background: rgba(251, 133, 0, 0.1);
}

/* Avatar Sizing System */
.character-avatar-container {
    display: inline-block;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.character-avatar-container.size-32 {
    width: 32px;
    height: 32px;
}

.character-avatar-container.size-40 {
    width: 40px;
    height: 40px;
}

.character-avatar-container.size-48 {
    width: 48px;
    height: 48px;
}

.character-avatar-container.size-60 {
    width: 60px;
    height: 60px;
}

.character-avatar-container.size-64 {
    width: 64px;
    height: 64px;
}

.character-avatar-container.size-80 {
    width: 80px;
    height: 80px;
}

/* Chakra Glow Animation */
@keyframes chakraPulse {
    0% {
        box-shadow: 0 0 5px var(--ninja-orange);
    }

    50% {
        box-shadow: 0 0 20px var(--ninja-orange-glow);
    }

    100% {
        box-shadow: 0 0 5px var(--ninja-orange);
    }
}

.naruto-theme .table td,
.naruto-theme .table th {
    border-top: 1px solid var(--ninja-border);
}

/* Form Elements Styling */
.naruto-theme .form-control,
.naruto-theme .form-select {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--ninja-border) !important;
    color: #fff !important;
    transition: all 0.3s;
}

.naruto-theme .form-control:focus,
.naruto-theme .form-select:focus {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-color: var(--ninja-orange) !important;
    box-shadow: 0 0 10px rgba(251, 133, 0, 0.3);
}

.naruto-theme .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Card & Modal Overrides - Changed to background-color to preserve original background-images */
.naruto-theme .card {
    background-color: var(--ninja-glass) !important;
    border: 1px solid var(--ninja-border);
    backdrop-filter: blur(20px);
}

/* Ensure character background (bg1.png) still displays */
.naruto-theme .bg-character {
    background-image: url(../img/bg1.png) !important;
    background-size: cover !important;
    background-color: transparent !important;
}

.naruto-theme .modal-content {
    background-color: #0d120f !important;
    border: 1px solid var(--ninja-border);
    color: #fff;
}

.naruto-theme .modal-header,
.naruto-theme .modal-footer {
    border-color: var(--ninja-border);
}

/* Badge Overrides */
.naruto-theme .badge.bg-light-primary {
    background-color: rgba(251, 133, 0, 0.1) !important;
    color: var(--ninja-orange-glow) !important;
    border: 1px solid var(--ninja-border);
}

/* Header - Shining Golden style with Texture Blend */
.naruto-header {
    background: rgba(10, 15, 12, 0.85) !important;
    backdrop-filter: blur(25px);
    border-bottom: 4px solid var(--ninja-orange);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1000;
}

.naruto-header .nav-link {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.85) !important;
    transition: all 0.3s;
}

.naruto-header .nav-link:hover {
    color: var(--ninja-orange-glow) !important;
    text-shadow: 0 0 10px rgba(255, 183, 3, 0.5);
}

/* Clean Footer - Stable midnight theme */
.footer.naruto-footer {
    background: rgba(8, 12, 10, 0.9) !important;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid var(--ninja-border);
    padding: 35px 0;
    font-size: 0.9rem;
}

.footer.naruto-footer p {
    font-weight: 400;
    letter-spacing: 0.8px;
}

.footer.naruto-footer a {
    color: var(--ninja-orange-glow);
    text-decoration: none;
    font-weight: 600;
}

/* Card Modern Style - Subtle & Dark */
.ninja-scroll-card {
    background: rgba(20, 25, 22, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid var(--ninja-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 25px;
}

/* Button Modern Naruto - Shining Gold */
.btn-naruto {
    background: linear-gradient(135deg, var(--ninja-orange), #ff4e50);
    border: none;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    border-radius: 50px;
    padding: 12px 30px;
    box-shadow: 0 4px 15px rgba(251, 133, 0, 0.3);
}

.btn-naruto:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(251, 133, 0, 0.5);
    filter: brightness(1.1);
}

/* Download Buttons Sidebar Cleanup - Transparent Background */
.download-btn-img {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-btn-img:hover {
    transform: translateY(-5px) scale(1.05);
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
}