/* style.css - Custom styles for Gaming Tournament App (User and Admin Panels) */

/* --- Dark Theme Variables --- */
:root {
    --primary-bg: #0F172A; /* Slate 900 */
    --secondary-bg: #1E293B; /* Slate 800 */
    --card-bg: #1E293B; /* Slate 800 - Game cards background */
    --sidebar-bg: #111827; /* Gray 900 - Primarily for Admin Sidebar */
    --text-primary: #E2E8F0; /* Slate 200 */
    --text-secondary: #94A3B8; /* Slate 400 */
    --text-muted-custom: #64748B; /* Slate 500 - Improved visibility for muted text */
    --accent-color: #FACC15; /* Yellow 500 */
    --accent-gradient: linear-gradient(to right, #FACC15, #FBBF24);
    --primary-button-bg: #3B82F6; /* Blue 500 */
    --border-color: #334155; /* Slate 700 */
    --success-color: #10B981; /* Emerald 500 */
    --danger-color: #EF4444; /* Red 500 */
    --warning-color: #F59E0B; /* Amber 500 */
    --info-color: #60A5FA; /* Blue 400 */
    --link-color: #9CA3AF; /* Gray 400 */
    --link-hover-color: #E5E7EB; /* Gray 200 */
    --placeholder-bg: rgba(100, 116, 139, 0.15); /* Slate 500 with opacity */
    --bottom-nav-bg: #1E293B; /* Slate 800 - Bottom navigation background */
}

/* --- General Body & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    /* padding-top/bottom will be applied specifically to main content based on header/footer */
    overscroll-behavior-y: contain; /* Prevent excessive pull-to-refresh */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #FBBF24; /* Slightly darker accent on hover */
    text-decoration: none;
}

/* --- Layout & Structure --- */
.main-content {
    padding: 15px;
    /* Dynamic padding based on header/footer presence */
    padding-top: 70px; /* Default padding for user panel (header height + margin) */
    padding-bottom: 75px; /* Default padding for user panel (bottom nav height + margin) */
}

/* Hide sections by default, show only active one */
.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out; /* Smooth transition when section becomes active */
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.1rem; /* Adjusted for general use */
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* --- Cards & Containers --- */
.custom-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.card {
    /* Overrides default Bootstrap card */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    margin-bottom: 1.5rem; /* Consistent margin */
}

.card-title {
    color: var(--text-primary);
}

/* --- Buttons --- */
.btn-custom {
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 15px;
    border: none;
    display: inline-flex; /* Allow icon and text inline */
    align-items: center;
    justify-content: center;
    gap: 5px; /* Space between icon and text */
    transition: background-color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn-custom-primary {
    background-color: var(--primary-button-bg);
    color: var(--text-primary); /* Using text-primary for contrast */
}
.btn-custom-primary:hover { background-color: #2563EB; /* A slightly darker blue */ }

.btn-custom-secondary {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-custom-secondary:hover { background-color: #334155; /* Darker slate */ }

.btn-custom-accent {
    background: var(--accent-gradient);
    color: var(--primary-bg); /* Dark text on bright gradient */
    font-weight: 600;
}
.btn-custom-accent:hover { filter: brightness(1.1); }

.btn-custom-link {
    background: none;
    border: none;
    color: var(--primary-button-bg); /* Use primary button color for links */
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    text-decoration: underline; /* Make it look more like a link */
    transition: color 0.2s ease;
}
.btn-custom-link:hover { color: #2563EB; text-decoration: underline; }

/* Small buttons for actions */
.btn-sm {
    padding: 0.4rem 0.8rem; /* Smaller padding */
    font-size: 0.85rem; /* Smaller font */
}

/* --- Text Colors --- */
.text-accent { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-secondary { color: var(--text-secondary) !important; } /* Override Bootstrap default */
.text-muted-custom { color: var(--text-muted-custom) !important; } /* Custom muted text */

/* --- Forms --- */
.form-control, .form-select {
    background-color: var(--primary-bg); /* Dark background */
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--primary-bg);
    border-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(250, 204, 21, 0.25); /* Accent color glow */
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-label {
    color: var(--text-secondary); /* Muted label color */
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

textarea.form-control {
    min-height: 100px; /* Default height for textareas */
    resize: vertical; /* Allow vertical resizing */
}


/* --- Alerts --- */
.alert {
    border-radius: 6px;
    font-size: 0.9rem;
    /* Bootstrap provides background/color based on class (alert-success, alert-danger etc.) */
}

/* --- Lists (e.g., Profile links) --- */
.list-group-item {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect */
}

.list-group-item:last-child {
    border-bottom: none; /* No bottom border on the last item */
}

.list-group-item i:first-child {
    color: var(--accent-color); /* Icon color */
    margin-right: 15px;
    font-size: 1.1rem;
    width: 20px; /* Fixed width for consistent alignment */
    text-align: center;
}

.list-group-item .bi-chevron-right {
    color: var(--text-secondary); /* Arrow icon color */
    font-size: 0.9rem;
}

.interactive-list-item {
    cursor: pointer; /* Indicate clickability */
}

/* --- Specific UI Elements (User Panel) --- */

/* Authentication Forms (Login/Signup) - common container styles */
.auth-container {
     max-width: 450px;
     width: 95%;
     margin: auto;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Ensure header is above content */
    border-bottom: 1px solid var(--border-color);
}

.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 40px; height: 40px; border-radius: 50%; background-color: #fff; object-fit: cover; border: 1px solid var(--accent-color); } /* User panel logo size */
.header-title { font-size: 0.9rem; font-weight: 500; line-height: 1.2; }
.header-title span { font-size: 0.75rem; color: var(--text-secondary); display: block; }
.header-back-button { background: none; border: none; color: var(--text-primary); font-size: 1.4rem; margin-right: 5px; display: none; padding: 5px; } /* Hidden by default */
.header-right { display: flex; align-items: center; gap: 15px; }

.notification-icon {
    font-size: 1.3rem;
    color: var(--text-primary);
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.notification-badge { position: absolute; top: -3px; right: -5px; background-color: var(--danger-color); color: white; font-size: 0.6rem; width: 15px; height: 15px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; }

.wallet-chip {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: filter 0.2s ease;
}
.wallet-chip i { margin-right: 5px; font-size: 0.9rem; }
.wallet-chip:hover { filter: brightness(1.1); }


/* Header Game Title (shown on tournament list page) */
.header-game-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 10px;
    display: none; /* Hidden by default */
}


/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    /* Ensure solid background color for the footer */
    background-color: var(--bottom-nav-bg); /* Using the defined variable */
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Ensure above content */
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    flex-grow: 1; /* Distribute space equally */
    padding: 8px 0;
    transition: color 0.2s ease, background-color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.7rem; /* Smaller font for label */
}

.nav-item i {
    font-size: 1.4rem; /* Icon size */
    margin-bottom: 4px; /* Space between icon and text */
    line-height: 1; /* Prevent extra space below icon */
}
.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
}

.nav-item.active {
    color: var(--accent-color);
    background-color: rgba(250, 204, 21, 0.1); /* Subtle accent background */
}
.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}


/* Promotion Slider (Swiper) */
.swiper-container#promotionSliderEl {
    width: 100%;
    height: 200px; /* Fixed height */
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden; /* Ensure rounded corners */
    /* Custom pagination colors */
    --swiper-pagination-color: var(--accent-color);
    --swiper-pagination-bullet-inactive-color: var(--text-secondary);
    --swiper-pagination-bullet-size: 8px;
}

.swiper-slide {
    background-color: var(--secondary-bg); /* Background if image doesn't cover */
    border-radius: 10px; /* Apply to slides as well */
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the slide area */
    border-radius: 10px;
}


/* Game Cards (Home Page) */
.game-card {
    text-align: center;
    /* Ensure solid background color for game cards */
    background-color: var(--card-bg); /* Using the defined variable #1E293B */
    border-radius: 8px;
    overflow: hidden;
    padding: 0; /* Image covers the top */
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Added for potential icon positioning */
    position: relative;
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack image and text */
    height: 100%; /* Ensure consistent height if in a grid */
}

.game-card:hover {
    transform: translateY(-3px); /* Lift effect on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.game-card img {
    width: 100%;
    height: 130px; /* Fixed image height */
    object-fit: cover;
    display: block;
    /* Ensure image takes up the top part */
    flex-shrink: 0; /* Prevent image from shrinking */
}

.game-card span {
    display: block;
    padding: 10px 5px; /* Padding below image */
    font-weight: 500;
    font-size: 0.9rem;
    /* Change: Set game title text color to white as seen in screenshot */
    color: #ffffff;
    /* Ensure text grows to fill space if needed */
    flex-grow: 1;
    display: flex; /* Use flex to center text vertically if it's the only content below the image */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
}

/* Added style for potential icon within game card (like settings icon) */
/* Assuming the icon is wrapped in an element with class 'game-card-icon' or similar */
.game-card .game-card-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem; /* Adjust size as needed */
    color: var(--text-secondary); /* Default icon color */
    /* Example for the settings icon specifically */
    /* .game-card .game-card-icon.settings { color: var(--text-muted-custom); } */
    z-index: 10; /* Ensure icon is above the image */
}


/* Tournament Tabs */
.tournament-tabs {
    display: flex;
    justify-content: space-around; /* Distribute tabs evenly */
    background-color: var(--secondary-bg);
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.tab-item {
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    flex-grow: 1; /* Take equal space */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.tab-item.active { background-color: var(--primary-button-bg); color: var(--text-primary); }
.tab-item:hover:not(.active) { background-color: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.tab-item i { margin-right: 5px; }


/* Tournament Cards (User Panel) */
.tournament-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
}

.tournament-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 5px;
}

.tournament-card-tags span {
    background-color: var(--primary-bg);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block; /* Allows margin/padding */
    border: 1px solid var(--border-color);
    margin-right: 4px;
    margin-bottom: 4px; /* For wrapping */
}

.tournament-card-timer {
    background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent background */
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.tournament-card-title {
    font-size: 1rem; /* Slightly smaller title in card */
    font-weight: 600;
    margin-bottom: 5px;
    display: flex; /* Align icon and text */
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
.tournament-card-title i { color: var(--accent-color); }

.tournament-card-info {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* Ensure equal height */
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding: 10px 0;
    margin: 10px 0;
    font-size: 0.8rem;
}
.info-item { text-align: center; flex: 1; padding: 0 5px; border-right: 1px solid var(--border-color); }
.info-item:last-child { border-right: none; }
.info-item span { display: block; color: var(--text-secondary); font-size: 0.7rem; margin-bottom: 2px; }
.info-item strong { color: var(--text-primary); font-weight: 600; font-size: 0.9rem; }
.info-item .prize-icon { color: var(--accent-color); font-size: 1.2rem; }

.tournament-card-spots {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}
.tournament-card-spots span { font-weight: 600; }

.progress { height: 6px; background-color: var(--primary-bg); border-radius: 3px; overflow: hidden; }
.progress-bar { background-color: var(--warning-color); transition: width 0.3s ease; }


.tournament-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Details on left, Action on right */
    gap: 10px;
    margin-top: 10px;
}

.tournament-card-actions .btn-sm {
    padding: 8px 10px;
    font-size: 0.85rem;
    width: 100%; /* Full width within grid column */
}

.tournament-card-actions .btn-join {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    font-weight: 600;
    grid-column: 2 / 3; /* Place in the second column */
}

.tournament-card-actions .btn-details {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    grid-column: 1 / 2; /* Place in the first column */
}

.tournament-card-actions .btn-joined {
    background-color: var(--success-color);
    color: var(--text-primary);
    opacity: 0.8; /* Indicate disabled state */
    grid-column: 2 / 3;
    cursor: default; /* No pointer cursor */
}

.tournament-card-actions .btn-disabled {
    background-color: var(--secondary-bg);
    opacity: 0.6;
    cursor: not-allowed;
    grid-column: 2 / 3;
}

.btn-idpass {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    border: none;
    font-weight: 600;
    display: block; /* Full width button below actions */
    width: 100%;
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 6px;
    transition: filter 0.2s ease;
}
.btn-idpass:hover { filter: brightness(1.1); }


/* Wallet Section */
.wallet-card {
    background: linear-gradient(145deg, var(--secondary-bg), var(--primary-bg)); /* Gradient background */
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px; /* Space below the main wallet card */
}

.wallet-card h2 {
     /* Inherits section-title styles or custom here */
     font-size: 1.2rem;
     font-weight: 600;
     margin-bottom: 25px;
     color: var(--text-primary);
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color); /* Dashed separator */
}

.balance-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.balance-item-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.balance-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary); /* Primary text for balance value */
}

.balance-item-action {
    min-width: 100px; /* Fixed width for action column */
    text-align: right;
}

.balance-item-action .btn-custom-link {
    font-size: 0.85rem;
    color: var(--accent-color); /* Accent color for history link */
    padding: 5px;
}

.balance-item-action .btn-withdraw {
    background-color: var(--primary-button-bg);
    color: #fff; /* White text on blue */
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.balance-item-action .btn-withdraw:hover { background-color: #2563EB; }


/* Recent Transactions List */
#recentTransactionsListEl .custom-card {
    background-color: var(--secondary-bg); /* Slightly darker background for list items */
    padding: 10px 15px; /* Adjusted padding */
    margin-bottom: 8px; /* Smaller margin between items */
    border-radius: 8px; /* Slightly smaller border radius */
    border: 1px solid var(--border-color);
}
#recentTransactionsListEl .custom-card > div {
     display: flex;
     justify-content: space-between;
     align-items: center;
     font-size: 0.9rem;
}
#recentTransactionsListEl .custom-card .small {
     font-size: 0.8em;
}


/* Earnings Section */
#earnings-section .custom-card {
     text-align: center;
     /* Inherits custom-card styles */
}
#earnings-section .display-4 {
     font-size: 3rem;
     color: var(--accent-color);
     margin-bottom: 15px;
}
#earnings-section p strong {
     color: var(--text-primary);
     font-weight: 600;
     margin-left: 5px;
}


/* Profile Section */
.profile-header-card {
    background: linear-gradient(145deg, var(--secondary-bg), var(--primary-bg));
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid var(--accent-color);
    object-fit: cover;
    background-color: var(--primary-bg); /* Background for placeholder or missing image */
}

.profile-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 2px; color: var(--text-primary); }
.profile-email { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 15px; word-break: break-all; } /* Ensure long emails wrap */
.profile-phone { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 15px; }


.profile-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 0 5px; /* Space between items */
}
.stat-item strong { display: block; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.stat-item span { font-size: 0.75rem; color: var(--text-secondary); }


.profile-links .list-group {
    border-radius: 10px;
    overflow: hidden; /* Apply border-radius to list group */
    border: 1px solid var(--border-color);
}

.profile-links .form-switch .form-check-input {
    background-color: var(--secondary-bg); /* Off state background */
    border-color: var(--border-color);
    /* Custom SVG for switch thumb - needs to match theme */
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
}

.profile-links .form-switch .form-check-input:checked {
    background-color: var(--accent-color); /* On state background */
    border-color: var(--accent-color);
     /* Custom SVG for switch thumb - white */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}


/* Referral Code Display */
.referral-code {
    font-family: monospace; /* Monospaced font for code */
    letter-spacing: 1px;
    user-select: all; /* Allow easy selection/copying */
}


/* Placeholder/Loading Styles */
/* Hide the global loader element */
/* Assuming the loader element has the ID 'globalLoaderEl' */
#globalLoaderEl {
    display: none !important; /* Use !important to ensure it overrides any default or inline styles */
}

.placeholder-glow .placeholder {
    background-color: rgba(51, 65, 85, 0.5); /* Darker placeholder */
    animation: placeholder-glow 2s ease-in-out infinite;
}

.placeholder {
    background-color: rgba(51, 65, 85, 0.5);
    border-radius: 4px;
}

@keyframes placeholder-glow {
    0% { background-color: rgba(51, 65, 85, 0.5); }
    50% { background-color: rgba(51, 65, 85, 0.7); }
    100% { background-color: rgba(51, 65, 85, 0.5); }
}

/* Specific Placeholder styles for tables */
.loading-placeholder td > div {
     background-color: var(--placeholder-bg);
     border-radius: 4px;
     min-height: 1.2em; /* Ensure visibility */
     animation: placeholder-glow 2s ease-in-out infinite;
}


/* Modals */
.modal-content {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-header { border-bottom-color: var(--border-color); }
.modal-footer { border-top-color: var(--border-color); }

.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); } /* White close button on dark background */

.modal-body .admin-upi-id {
    color: var(--warning-color); /* Warning color for UPI ID */
    font-weight: bold;
    user-select: text;
    font-size: 1.1rem;
}

#adminUpiQrCodeEl {
    max-width: 180px;
    margin: 15px auto;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: block; /* Center the image */
}

#matchDetailsModalBodyEl pre {
    background-color: var(--primary-bg);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: pre-wrap; /* Wrap long text */
    word-wrap: break-word;
}

#policyModalBodyEl {
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap; /* Respect new lines from DB (\n) */
}

#idPasswordModalEl .copy-btn,
#policyModalBodyEl .copy-btn,
#policyModalBodyEl #shareReferralBtn {
     /* Styles for copy/share buttons in modals */
     padding: 2px 8px; /* Smaller padding */
     font-size: 0.85rem;
     margin-left: 8px;
     vertical-align: middle;
}
/* Adjust icon margin within buttons */
#policyModalBodyEl #shareReferralBtn i,
#policyModalBodyEl .copy-btn i { margin-right: 5px; }


/* --- Specific Admin Panel Styles --- */
body.admin-body {
     padding-top: 60px; /* Adjust padding for fixed admin header */
     padding-bottom: 0; /* No bottom nav in admin */
}
.admin-main-content {
     padding: 20px; /* Adjust padding */
}


.admin-header-logo {
    width: 35px; /* Slightly smaller logo for admin header */
    height: 35px;
    border-radius: 50%;
    background-color: #fff;
    object-fit: cover;
    border: 1px solid var(--accent-color);
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 0 5px;
    margin-left: -5px; /* Align better with edge */
    cursor: pointer;
}

.admin-email-header {
     font-size: 0.8rem;
     color: var(--text-secondary);
     display: none; /* Hidden on small screens */
}
@media (min-width: 576px) { .admin-email-header { display: inline; } } /* Show on small-plus screens */


/* Admin Sidebar (Offcanvas) */
.offcanvas-start {
    background-color: var(--sidebar-bg);
    color: var(--link-color);
    width: 260px !important; /* Fixed width */
    border-right: 1px solid var(--border-color);
}
.offcanvas-header { border-bottom: 1px solid var(--border-color); padding: 1rem 1.2rem;}
.offcanvas-title h5 { color: var(--text-primary); margin-bottom: 0; font-size: 1.1rem; }
.offcanvas-body { padding: 0; display: flex; flex-direction: column; height: calc(100% - 60px); } /* Adjust height based on header */
.offcanvas-body .nav { flex-grow: 1; overflow-y: auto; padding-bottom: 1rem; } /* Allow scrolling */
.offcanvas-body .nav-link { color: var(--link-color); padding: 0.8rem 1.2rem; border-left: 3px solid transparent; font-size: 0.95rem; transition: color 0.2s, background-color 0.2s, border-left-color 0.2s; }
.offcanvas-body .nav-link.active, .offcanvas-body .nav-link:hover { color: var(--link-hover-color); background-color: rgba(255, 255, 255, 0.05); border-left-color: var(--accent-color);}
.offcanvas-body .nav-link i { margin-right: 12px; width: 20px; text-align: center; font-size: 1.1rem;}
.offcanvas-logout-btn { margin: 1rem; border-top: 1px solid var(--border-color); padding-top: 1rem; text-align: center; } /* Style for logout button area */

/* Admin Dashboard Stats */
.dash-card-icon {
    font-size: 1.8rem;
    opacity: 0.6;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5); /* Slightly transparent white icon */
}
.card-body { position: relative; } /* Needed for absolute positioning of icon */

/* Admin Tables */
.table-responsive { overflow-x: auto; }
.table { background-color: var(--card-bg); color: var(--text-primary); border-color: var(--border-color); margin-bottom: 0;}
.table > :not(caption) > * > * { background-color: transparent !important; border-bottom-color: var(--border-color); }
.table th { color: var(--text-secondary); font-weight: 500; white-space: nowrap; padding: 0.8rem 1rem;}
.table td { vertical-align: middle; white-space: nowrap; padding: 0.7rem 1rem;}
.table td .text-muted { color: var(--text-muted-custom) !important; }
.table td small.text-muted { font-size: 0.85em; }
.table-hover > tbody > tr:hover > * { background-color: rgba(255, 255, 255, 0.03) !important; color: var(--text-primary); }

.action-buttons button, .action-buttons a { margin-right: 5px; margin-bottom: 5px; display: inline-block; } /* Ensure buttons are inline-block for spacing */

.table img.preview-img { max-width: 60px; height: 40px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid var(--border-color); }

/* Custom Text Background Colors (from Bootstrap) */
.text-bg-primary { background-color: #3B82F6 !important; } /* Blue 500 */
.text-bg-info { background-color: #0ea5e9 !important; }     /* Cyan 500 */
.text-bg-warning { background-color: #f59e0b !important; }   /* Amber 500 */
.text-bg-success { background-color: #10b981 !important; }   /* Emerald 500 */
.text-bg-danger { background-color: #ef4444 !important; }    /* Red 500 */
.text-bg-secondary { background-color: #6b7280 !important; } /* Gray 500 - Default Bootstrap Secondary */
.text-bg-dark { background-color: #374151 !important; }      /* Gray 700 - Suitable for Rejected */


/* Admin Tabs */
.nav-tabs .nav-link { color: var(--text-secondary); border-color: var(--border-color); border-bottom-color: transparent; margin-bottom: -1px;}
.nav-tabs .nav-link.active { color: var(--accent-color); background-color: var(--card-bg); border-color: var(--border-color); border-bottom-color: var(--card-bg); font-weight: 600; }
.nav-tabs { border-bottom-color: var(--border-color); }

/* Utility */
.copy-btn { cursor: pointer; opacity: 0.6; transition: opacity 0.2s; }
.copy-btn:hover { opacity: 1; }

.status-badge { font-size: 0.8em; padding: 0.3em 0.6em; border-radius: 0.25rem; display: inline-block; /* Allows padding/margin */ }

/* Hide Bootstrap Modals/Offcanvas backdrop when modal is open from offcanvas */
/* Helps prevent double dimming */
.offcanvas.show ~ .modal-backdrop { display: none !important; }


/* Toast Messages */
.toast {
    /* Positioning handled by JS adding classes */
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    /* Inherit variants like text-bg-success for colors */
}
.toast-header {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}
.toast-body {
    /* Inherit colors from text-bg-* classes */
}

/* Improve visibility of text within colored toasts */
.toast.text-bg-success .toast-body { color: #fff; }
.toast.text-bg-danger .toast-body { color: #fff; }
.toast.text-bg-warning .toast-body { color: #1f2937; } /* Dark text on warning */
.toast.text-bg-info .toast-body { color: #fff; }
.toast.text-bg-primary .toast-body { color: #fff; }

/* Specific styles for the toast message function HTML */
/* These might need adjustment depending on toast_message.php implementation */
.toast-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1090; /* Above modals (1050), below tooltips/popovers (1070, 1080) */
    padding: 15px;
    pointer-events: none; /* Allow clicks through container */
}

.toast-container .toast {
    pointer-events: auto; /* Re-enable clicks on toast itself */
}

/* Security Warning */
#securityWarning {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 15px;
    text-align: center;
    font-size: 0.9rem;
    position: sticky;
    top: 60px; /* Adjust if header height changes */
    z-index: 999;
    border-bottom: 1px solid #a51d1d;
}

#securityWarning a {
    color: #ffdddd;
    text-decoration: underline;
}

#securityWarning button {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 2px 8px;
    margin-left: 15px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}


/* Adjust main content padding for Admin Panel when sidebar is shown on larger screens (Optional) */
/*
@media (min-width: 992px) {
    body.admin-body.sidebar-open .admin-main-content {
        margin-left: 260px; // Match sidebar width
    }
}
*/