/* TeleVIP Custom Styles - Galactic Theme */

:root {
    --primary-color: #7c5cfc;
    --secondary-color: #34d399;
    --danger-color: #f87171;
    --dark-color: #0b0e1a;
    --light-bg: #0d1b2a;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #e2e8f0;
    animation: pageEntrance 0.4s ease-out backwards;
    overscroll-behavior-y: none;

    /* Same galaxy background as landing.css — loaded here so ALL pages
       (including base.html pages) render the nebula from the first CSS file */
    background-color: #050816;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(26, 10, 62, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 82% 18%, rgba(56, 189, 248, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 75% 75%, rgba(124, 92, 252, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 45% 25%, rgba(240, 147, 251, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 10% 85%, rgba(52, 211, 153, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse 40% 30% at 95% 45%, rgba(251, 191, 36, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse 90% 70% at 50% 50%, rgba(18, 8, 46, 0.5) 0%, rgba(11, 14, 26, 0.8) 50%, transparent 80%),
        linear-gradient(180deg, #050816 0%, #0a0d1f 15%, #0b0e1a 30%, #1a0a3e 50%, #0d1b2a 70%, #080b16 85%, #050816 100%);
    background-attachment: fixed;
    background-size: cover;
}

main {
    flex: 1;
}

/* ========================================
   Navbar Glassmorphic — Logged-in Area
   ======================================== */
.navbar-dark {
    background: rgba(11, 14, 26, 0.82) !important;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    z-index: 1030;
    position: sticky;
    top: 0;
    transition: background 0.3s ease;
}

/* Animated gradient border bottom */
.navbar-dark::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #7c5cfc 20%,
        #38bdf8 50%,
        #7c5cfc 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: navBorderGlow 4s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes navBorderGlow {
    0%, 100% { background-position: 0% 0; }
    50% { background-position: 100% 0; }
}

.navbar-dark .navbar-brand {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.2s ease;
}

.navbar-dark .navbar-brand:hover {
    transform: scale(1.03);
}

.navbar-dark .navbar-brand i {
    color: #38bdf8;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

/* Nav links with active pill */
.navbar-dark .nav-link {
    color: #b0b4cc;
    transition: color 0.25s ease, background 0.25s ease;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    position: relative;
    font-weight: 500;
    font-size: 0.92rem;
}

.navbar-dark .nav-link i {
    font-size: 1rem;
    margin-right: 0.25rem;
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .nav-link:focus-visible {
    color: #ffffff;
    background: rgba(124, 92, 252, 0.1);
}

.navbar-dark .nav-link:hover i {
    opacity: 1;
}

.navbar-dark .nav-link:active {
    color: #ffffff !important;
    background: rgba(124, 92, 252, 0.2);
    border-radius: 10px;
}

/* Active page indicator — glowing pill */
.navbar-dark .nav-link.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(124, 92, 252, 0.18);
}

.navbar-dark .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #7c5cfc, #38bdf8);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(124, 92, 252, 0.6);
}

.navbar-dark .nav-link.active i {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(124, 92, 252, 0.5));
}

/* User dropdown trigger */
.navbar-dark .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.navbar-dark .dropdown-toggle:active,
.navbar-dark .dropdown-toggle:focus {
    color: #ffffff !important;
}

/* Glassmorphic dropdown */
.navbar .dropdown-menu {
    background: rgba(15, 18, 32, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(124, 92, 252, 0.25);
    border-radius: 14px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(124, 92, 252, 0.1) inset;
    z-index: 1035;
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.navbar .dropdown-item {
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.navbar .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.navbar .dropdown-item:hover {
    background: rgba(124, 92, 252, 0.15);
    color: #ffffff;
}

.navbar .dropdown-item:hover i {
    opacity: 1;
}

.navbar .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.08);
    margin: 0.3rem 0;
}

/* Mobile navbar tweaks */
@media (max-width: 991px) {
    .navbar-dark .navbar-collapse {
        background: rgba(11, 14, 26, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        padding: 0.75rem;
        margin-top: 0.5rem;
        border: 1px solid rgba(124, 92, 252, 0.15);
    }

    .navbar-dark .nav-link {
        padding: 0.65rem 1rem;
    }

    .navbar-dark .nav-link.active::after {
        display: none;
    }

    .navbar-dark .nav-link.active {
        background: rgba(124, 92, 252, 0.2);
        border-left: 3px solid #7c5cfc;
        border-radius: 0 10px 10px 0;
    }
}

/* Nav avatar mini-circle */
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c5cfc, #38bdf8);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.3rem;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(124, 92, 252, 0.4);
}

/* Navbar toggler galactic */
.navbar-dark .navbar-toggler {
    border-color: rgba(124, 92, 252, 0.3);
    padding: 0.35rem 0.6rem;
}

.navbar-dark .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(124, 92, 252, 0.25);
}

/* ========================================
   Navbar Custom (public pages via base.html)
   Mirrors landing.css .navbar-custom so pages
   like privacy, terms, report get consistent nav
   ======================================== */
.navbar-custom {
    background: #0b0e1a;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 92, 252, 0.08);
    border-bottom: 1px solid rgba(124, 92, 252, 0.15);
    padding: 12px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.navbar-custom .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-custom .navbar-collapse {
    justify-content: flex-end;
}

.navbar-custom .navbar-brand {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c5cfc 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-custom .navbar-toggler {
    border: 1px solid rgba(124, 92, 252, 0.3);
    padding: 4px 8px;
}

.navbar-custom .navbar-toggler:focus {
    box-shadow: none;
}

.navbar-custom .navbar-toggler-icon {
    filter: invert(1);
}

@media (max-width: 991px) {
    .navbar-custom .navbar-collapse {
        background: #0f1220;
        margin-top: 12px;
        padding: 20px;
        border-radius: 12px;
        border: 1px solid rgba(124, 92, 252, 0.25);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    }
}

.navbar-custom .nav-link,
.navbar-custom .nav-link:visited,
.navbar-custom .nav-link:link {
    color: #c8cce0 !important;
    font-weight: 500;
    padding: 10px 16px;
    transition: all 0.3s ease;
    background: transparent;
}

.navbar-custom .nav-link:hover {
    color: #ffffff !important;
}

.navbar-custom .nav-link:active,
.navbar-custom .nav-link:focus,
.navbar-custom .nav-link:focus-visible {
    color: #ffffff !important;
    background: rgba(124, 92, 252, 0.25) !important;
    border-radius: 8px;
}

.navbar-custom .btn-nav-cta,
.navbar-custom .btn-nav-cta:visited,
.navbar-custom .btn-nav-cta:link {
    background: linear-gradient(135deg, #7c5cfc 0%, #38bdf8 100%);
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 700;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 2px 12px rgba(124, 92, 252, 0.4);
}

.navbar-custom .btn-nav-cta:hover {
    box-shadow: 0 4px 24px rgba(124, 92, 252, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
}

@media (min-width: 992px) {
    .navbar-custom .navbar-nav {
        align-items: center;
    }

    .navbar-custom .nav-item:last-child {
        margin-left: 20px;
    }

    .navbar-custom .btn-nav-cta {
        margin-top: 0;
        margin-left: 20px;
    }
}

/* Card Animations */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    background: rgba(15, 18, 32, 0.88);
    border: 1px solid rgba(124, 92, 252, 0.2);
    color: #e2e8f0;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(124, 92, 252, 0.1);
}

/* Stats Cards — legacy border-left removed; see dashboard.css for galactic variant */

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Group Cards */
.group-card {
    position: relative;
    overflow: hidden;
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #38bdf8);
}

/* Charts Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Profile Avatar */
.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

/* Plan Cards */
.plan-card {
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.plan-card.popular {
    border-color: var(--primary-color);
    position: relative;
}

.plan-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Transaction List */
.transaction-item {
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.transaction-item.pending {
    border-left-color: #fbbf24;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #b0b4cc;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.875rem;
    }

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

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Badge Styles */
.badge-gradient {
    background: linear-gradient(135deg, var(--primary-color), #38bdf8);
    color: white;
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(124, 92, 252, 0.25);
}

/* Button Styles */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color), #5a3fd4);
    color: white;
    border: none;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #5a3fd4, var(--primary-color));
    color: white;
}

/* Global alert overrides for dark background */
.alert-info {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Flash messages container - keep readable */
.container .alert {
    backdrop-filter: blur(10px);
}

/* Global button primary override */
.btn-primary {
    background: linear-gradient(135deg, #7c5cfc 0%, #38bdf8 100%);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 5px 20px rgba(124, 92, 252, 0.3);
}

/* ========================================
   Dashboard Footer (authenticated area)
   ======================================== */
.dash-footer {
    background: rgba(11, 14, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(124, 92, 252, 0.12);
    padding: 1.25rem 0;
    position: relative;
    z-index: 3;
    margin-top: 3rem;
}

.dash-footer-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}

.dash-footer-brand i {
    color: #38bdf8;
    margin-right: 0.2rem;
}

.dash-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dash-footer-links a {
    color: #b0b4cc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.dash-footer-links a:hover {
    color: #7c5cfc;
}

.dash-footer-links .sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.dash-footer-copy {
    color: #6b7094;
    font-size: 0.8rem;
}

@media (max-width: 767px) {
    .dash-footer .row {
        text-align: center !important;
    }
    .dash-footer .text-md-end {
        text-align: center !important;
    }
}
