/* ===================================================================
   TG-THEME.CSS  –  TestGlider-style shared design system
   Used by: index.php, trial.php, user/index.php, user/packages.php,
            user/profile.php, user/test.php
   =================================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --tg-blue: #1e40af;
    --tg-blue-hover: #1d4ed8;
    --tg-blue-light: #3b82f6;
    --tg-dark: #0f172a;
    --tg-text: #1f2937;
    --tg-text-muted: #6b7280;
    --tg-border: #e5e7eb;
    --tg-bg: #f0f4ff;
    --tg-surface: #ffffff;
    --tg-surface-alt: #f9fafb;
    --tg-radius: 16px;
    --tg-radius-sm: 12px;
    --tg-radius-pill: 999px;
    --tg-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --tg-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --tg-shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --tg-max-w: 1100px;
}

body.tg-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--tg-bg);
    color: var(--tg-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ===== NAVBAR ===== */
.tg-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tg-border);
    padding: 0.6rem 0;
    transition: box-shadow 0.3s ease;
}
.tg-navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.tg-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.tg-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--tg-blue);
    font-weight: 700;
    font-size: 1.35rem;
}
.tg-brand img { height: 36px; }
.tg-brand i { font-size: 1.5rem; }

.tg-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tg-nav-links a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.tg-nav-links a:hover,
.tg-nav-links a.active { background: #f3f4f6; color: var(--tg-blue); }
.tg-nav-links .divider {
    width: 1px;
    height: 20px;
    background: #d1d5db;
    margin: 0 0.25rem;
}

.tg-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn-tg-primary {
    background: var(--tg-blue);
    color: #fff;
    border-radius: var(--tg-radius-pill);
    padding: 0.55rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}
.btn-tg-primary:hover { background: var(--tg-blue-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,64,175,0.25); }
.btn-tg-primary:active { transform: translateY(0); }

.btn-tg-outline {
    background: #fff;
    color: var(--tg-blue);
    border-radius: var(--tg-radius-pill);
    padding: 0.55rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1.5px solid var(--tg-blue);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}
.btn-tg-outline:hover { background: #e8efff; color: var(--tg-blue); }

.btn-tg-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn-tg-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

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

.btn-login-nav {
    background: #fff;
    color: #374151 !important;
    border-radius: var(--tg-radius-pill);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #d1d5db;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-login-nav:hover { border-color: var(--tg-blue); color: var(--tg-blue) !important; }

.btn-purchase {
    background: var(--tg-blue);
    color: #fff !important;
    border-radius: var(--tg-radius-pill);
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-purchase:hover { background: var(--tg-blue-hover); transform: translateY(-1px); }

/* ===== HERO (inner pages) ===== */
.tg-hero {
    background: linear-gradient(135deg, var(--tg-dark) 0%, #1e3a5f 50%, var(--tg-blue) 100%);
    color: #fff;
    padding: 3.5rem 0 2.5rem;
    margin-top: 52px; /* navbar height */
    text-align: center;
}
.tg-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #fff;
}
.tg-hero p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}
.tg-hero .hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

/* ===== MAIN CONTENT WRAPPER ===== */
.tg-main {
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.tg-main.with-hero { padding-top: 2rem; }
.tg-main.no-hero { padding-top: calc(52px + 2rem); }

/* ===== CARDS ===== */
.tg-card {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    padding: 1.75rem;
    transition: all 0.25s;
}
.tg-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tg-shadow-lg);
    border-color: #d1d5db;
}
.tg-card-flat {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    padding: 1.75rem;
}
.tg-card-highlight {
    border-color: var(--tg-blue);
}

/* ===== SECTION BLOCKS ===== */
.tg-section {
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.tg-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tg-text);
}
.tg-section-title .icon {
    width: 28px;
    height: 28px;
    background: var(--tg-blue);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* ===== STAT CARDS ===== */
.tg-stat-card {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-light));
    color: #fff;
    border-radius: var(--tg-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    margin-bottom: 1rem;
}
.tg-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30,64,175,0.3);
}
.tg-stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    color: #fff;
}
.tg-stat-card p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ===== ICON CIRCLES ===== */
.tg-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.tg-icon-circle.blue { background: #dbeafe; color: var(--tg-blue); }
.tg-icon-circle.green { background: #dcfce7; color: #16a34a; }
.tg-icon-circle.amber { background: #fef3c7; color: #d97706; }
.tg-icon-circle.red { background: #fee2e2; color: #dc2626; }
.tg-icon-circle.purple { background: #ede9fe; color: #7c3aed; }
.tg-icon-circle.solid-blue { background: var(--tg-blue); color: #fff; }

/* ===== AVATAR ===== */
.tg-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 0.75rem;
}

/* ===== FORM CONTROLS ===== */
.tg-form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--tg-text);
    margin-bottom: 0.4rem;
    display: block;
}
.tg-form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--tg-border);
    border-radius: var(--tg-radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: var(--tg-text);
}
.tg-form-control:focus {
    outline: none;
    border-color: var(--tg-blue);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
.tg-form-control[readonly] {
    background: var(--tg-surface-alt);
    cursor: default;
}

/* ===== TABS ===== */
.tg-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--tg-border);
    margin-bottom: 1.5rem;
}
.tg-tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tg-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tg-tab:hover { color: var(--tg-blue); }
.tg-tab.active {
    color: var(--tg-blue);
    border-bottom-color: var(--tg-blue);
}

/* ===== BADGES ===== */
.tg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--tg-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}
.tg-badge.blue { background: #dbeafe; color: var(--tg-blue); }
.tg-badge.green { background: #dcfce7; color: #16a34a; }
.tg-badge.amber { background: #fef3c7; color: #92400e; }
.tg-badge.red { background: #fee2e2; color: #dc2626; }
.tg-badge.gray { background: #f3f4f6; color: #374151; }
.tg-badge.dark { background: var(--tg-dark); color: #fff; }

/* ===== ALERTS ===== */
.tg-alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--tg-radius-sm);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tg-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.tg-alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.tg-alert.info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.tg-alert.warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tg-alert .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    color: inherit;
}
.tg-alert .close-btn:hover { opacity: 1; }

/* ===== LIST ITEMS ===== */
.tg-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--tg-surface-alt);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}
.tg-list-item:hover { background: #f0f4ff; transform: translateX(4px); }
.tg-list-item-info h6 {
    font-weight: 600;
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    color: var(--tg-text);
}
.tg-list-item-info p { margin: 0; font-size: 0.82rem; color: var(--tg-text-muted); }

/* ===== FOOTER ===== */
.tg-footer {
    background: var(--tg-dark);
    color: #e2e8f0;
    padding: 3rem 0 1rem;
    margin-top: 2rem;
}
.tg-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}
.tg-footer-col h6 {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 0.75rem;
}
.tg-footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.2rem 0;
    transition: color 0.2s;
}
.tg-footer-col a:hover { color: #fff; }

.tg-footer-bottom {
    border-top: 1px solid #1e293b;
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.tg-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.tg-footer-brand i { font-size: 1.3rem; }
.tg-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: 1rem;
}
.tg-footer-links a:hover { color: #fff; }
.tg-footer-disclaimer {
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.6;
}
.tg-footer-copyright {
    max-width: var(--tg-max-w);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #64748b;
}
.tg-footer-copyright a { color: #94a3b8; text-decoration: none; }
.tg-footer-copyright a:hover { color: #fff; }
.tg-social-links { display: flex; gap: 0.75rem; }
.tg-social-links a { color: #94a3b8; font-size: 1rem; text-decoration: none; }
.tg-social-links a:hover { color: #fff; }

/* ===== ANIMATIONS ===== */
.tg-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.tg-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== DROPDOWN (TG style) ===== */
.tg-dropdown {
    position: relative;
    display: inline-block;
}
.tg-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius-sm);
    box-shadow: var(--tg-shadow-lg);
    z-index: 50;
    overflow: hidden;
}
.tg-dropdown-menu.show { display: block; }
.tg-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    color: var(--tg-text);
    text-decoration: none;
    transition: background 0.15s;
}
.tg-dropdown-item:hover { background: #f3f4f6; color: var(--tg-blue); }

/* ===== UTILITIES ===== */
.tg-row { display: flex; gap: 1.5rem; }
.tg-col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.tg-col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.tg-col-6 { flex: 0 0 50%; max-width: 50%; }
.tg-col-12 { flex: 0 0 100%; max-width: 100%; }
.tg-gap-md { gap: 1rem; }
.tg-gap-lg { gap: 1.5rem; }
.tg-mb-sm { margin-bottom: 0.5rem; }
.tg-mb-md { margin-bottom: 1rem; }
.tg-mb-lg { margin-bottom: 1.5rem; }
.tg-mb-xl { margin-bottom: 2rem; }
.tg-mt-auto { margin-top: auto; }
.tg-text-center { text-align: center; }
.tg-text-muted { color: var(--tg-text-muted); }
.tg-text-sm { font-size: 0.85rem; }
.tg-text-xs { font-size: 0.75rem; }
.tg-fw-bold { font-weight: 700; }
.tg-fw-semi { font-weight: 600; }
.tg-d-flex { display: flex; }
.tg-align-center { align-items: center; }
.tg-justify-between { justify-content: space-between; }
.tg-flex-col { flex-direction: column; }
.tg-flex-1 { flex: 1; }
.tg-h-full { height: 100%; }
.tg-w-full { width: 100%; }
.tg-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tg-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tg-nav-links { display: none; }
    .tg-menu-toggle { display: block; }
    .tg-nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--tg-border);
        padding: 1rem;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    }
    .tg-nav-links.mobile-open .divider { display: none; }

    .tg-row { flex-direction: column; }
    .tg-col-8, .tg-col-4, .tg-col-6 { flex: 0 0 100%; max-width: 100%; }
    .tg-grid-2, .tg-grid-3 { grid-template-columns: 1fr; }

    .tg-hero h1 { font-size: 1.5rem; }
    .tg-hero { padding: 2.5rem 0 2rem; }
}
