/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    /* Brand Colors */
    --bg-dark: #0f172a;       /* Deep Navy (Main Background) */
    --bg-card: #1e293b;       /* Slightly Lighter (Card Background) */
    --accent: #fbbf24;        /* Tailor Yellow (Gold) */
    --accent-hover: #f59e0b;  /* Darker Gold for Hover */
    
    /* Text Colors */
    --text-main: #f8fafc;     /* White-ish */
    --text-muted: #94a3b8;    /* Grey text */
    
    /* Functional Colors */
    --success: #10b981;       /* Green */
    --danger: #ef4444;        /* Red */
    --glass-border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth; /* Essential for "Scroll to Section" feature */
}

body {
    font-family: 'Poppins', sans-serif; /* Modern Font */
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Styling (Pro Touch) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* =========================================
   2. UTILITY CLASSES (GLASSMORPHISM)
   ========================================= */
/* Premium Glass Effect */
.card-glass {
    background: rgba(30, 41, 59, 0.6); /* Semi-transparent */
    backdrop-filter: blur(16px);        /* Strong Blur */
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Hover Effect - DESKTOP ONLY to prevent sticky mobile hover */
@media (hover: hover) {
    .card-glass:hover {
        border-color: rgba(251, 191, 36, 0.3);
    }
}

/* =========================================
   3. COMPONENT OVERRIDES (BOOTSTRAP)
   ========================================= */

/* Inputs (Dark Theme) */
.form-control {
    background-color: #020617 !important; /* Very Dark */
    border: 1px solid #334155 !important;
    color: #fff !important;
    padding: 12px 15px;
    border-radius: 10px;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25) !important; /* Gold Glow */
    border-color: var(--accent) !important;
}

/* Fix for File Input (Meme Upload) to look Pro */
.form-control[type="file"] {
    padding: 10px;
}
.form-control::file-selector-button {
    background-color: #334155;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.form-control::file-selector-button:hover {
    background-color: var(--accent);
    color: #000;
}

/* Buttons */
.btn-warning {
    background-color: var(--accent);
    border: none;
    color: #000;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* FIX: Hover effect only on devices with mouse to prevent yellow stickiness on mobile */
@media (hover: hover) {
    .btn-warning:hover {
        background-color: var(--accent-hover);
        transform: translateY(-2px); /* Lift Effect */
        box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    }
    
    .btn-outline-light:hover {
        background-color: #334155;
        color: #fff;
    }
    
    .nav-pills .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: #fff;
    }
}

.btn-warning:active, .btn-warning.active {
    background-color: var(--accent-hover) !important;
    color: #000 !important;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.2); /* Pressed effect */
}

.btn-outline-light {
    border-color: #334155;
    color: var(--text-muted);
}

/* Nav Pills (Tabs) */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 50px;
    padding: 12px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.nav-pills .nav-link.active {
    background-color: var(--accent) !important;
    color: #0f172a !important; /* Dark Text */
    font-weight: 700;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4); /* Strong Glow */
}

/* =========================================
   4. TOOL SPECIFIC STYLES
   ========================================= */

/* Tool Visibility Animation */
.tool-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tool-content.active-tool {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeUp 0.5s ease-in-out forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Result Box (Analyzer) - OPTIMIZED MERGE */
.result-box {
    /* Pro Look Gradient */
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important; /* Subtle Gold Border */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(251, 191, 36, 0.05) !important;
    border-radius: 24px !important;
    padding: 2.5rem 1.5rem !important;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Adding a subtle top highlight */
.result-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.7;
}

/* --- CHART FIX FOR MOBILE --- */
.chart-mobile-fix {
    position: relative;
    width: 100%;
    height: 300px; 
}

@media (min-width: 992px) {
    .chart-mobile-fix {
        height: auto; 
        min-height: 400px;
    }
}

#chart-capture-area {
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: var(--bg-card); 
}

canvas#tokenomicsChart {
    max-width: 100%;
    margin: 0 auto;
}

/* =========================================
   5. CRYPTO GIFT CARD (DESIGN)
   ========================================= */
#printableCard {
    font-family: 'Courier New', Courier, monospace; /* Receipt Style */
    position: relative;
    overflow: hidden;
    border: 2px solid #000; 
}

/* FIX: Long Wallet Address Overflow */
.gift-card-footer-text {
    word-break: break-all;      /* Forces long address to wrap */
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 0.75rem;         /* Slightly smaller font for address */
    line-height: 1.2;
}

/* Print Media Query */
@media print {
    body * { visibility: hidden; }
    #printableCard, #printableCard * { visibility: visible; }
    #printableCard {
        position: absolute;
        left: 50%; top: 20px;
        transform: translateX(-50%);
        width: 100%; max-width: 500px;
        border: 1px solid #000;
        box-shadow: none;
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
    }
}

/* =========================================
   6. MEME WARDROBE & WATERMARKS
   ========================================= */
.meme-grid .card {
    border: 1px solid #334155;
    transition: transform 0.2s, border-color 0.2s;
}

@media (hover: hover) {
    .meme-grid .card:hover {
        transform: scale(1.02);
        border-color: var(--accent);
    }
}

.meme-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* --- UNIFIED WATERMARKS (UPDATED) --- */

/* 1. Analyzer Score Card (Light Text) */
.watermark-overlay {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

/* 2. Gift Card & Chart (Dark Text) */
.watermark-overlay-dark {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

/* 3. Meme (Shadowed Text - BIGGER & VISIBLE) */
.meme-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 90%; /* Ensure it stays within width */
    text-align: right; /* Align to right */
    font-size: 0.9rem !important; /* Size reduced from 1.4rem */
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px #000;
    pointer-events: none;
    padding: 0;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 1px;
    z-index: 20;
}

/* =========================================
   7. PRO ANALYSIS CARD DESIGN (ROTATION & SIZE FIX)
   ========================================= */

/* 1. The Container - SIZE INCREASED (Was 160px, Now 220px) */
.score-pro-ring {
    position: relative;
    width: 220px;  /* 🚨 Increased Size */
    height: 220px; /* 🚨 Increased Size */
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

/* 2. The Spinning Gradient Ring (Applied to ::before) */
.score-pro-ring::before {
    content: '';
    position: absolute;
    inset: -8px; /* 🚨 Thicker Ring */
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-hover), var(--success), var(--accent-hover));
    z-index: 0;
    animation: spinSlow 4s linear infinite; /* ONLY this spins */
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.4);
}

/* 3. The Static Inner Circle (Holds Text) */
.score-inner-circle {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0f172a; /* Dark background covers gradient center */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Sit on top of spinner */
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.8);
    padding: 15px; /* Padding to keep text safe */
}

/* Font Size Adjustment for Score inside Ring */
.score-inner-circle h2 {
    font-size: 3rem; /* Big Score */
    margin-bottom: 0;
    line-height: 1;
}

.score-inner-circle small {
    font-size: 1rem;
    opacity: 0.7;
}

/* Animation Logic */
@keyframes spinSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   8. PRO MOBILE OPTIMIZATION SUITE
   ========================================= */

@media (max-width: 768px) {
    
    /* Typography Scaling */
    h1.display-4 { font-size: 2rem !important; }
    .lead { font-size: 1rem !important; }
    h2 { font-size: 1.5rem !important; }

    /* Layout & Spacing */
    .hero-section { padding: 40px 0 !important; }
    .container { padding-left: 15px; padding-right: 15px; }
    .tool-content { padding: 20px !important; }

    /* Full Width Tool Buttons */
    .nav-pills {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: transparent; /* Remove bg on mobile */
    }
    .nav-pills .nav-link {
        width: 100%;
        margin: 5px 0;
        text-align: center;
        background: rgba(255,255,255,0.05); /* Individual bg */
    }

    /* Navbar Menu */
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98);
        padding: 20px;
        border-radius: 12px;
        margin-top: 15px;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Action Buttons Stack */
    #measure-tool .d-flex button,
    #chart-actions button,
    #meme-tool .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Watermark Resize */
    .watermark-overlay {
        font-size: 0.7rem !important;
        opacity: 0.8;
    }
    
    .meme-watermark {
        font-size: 0.75rem !important;
        bottom: 5px;
        right: 5px;
    }

    /* Stats Labels Visibility Fix */
    .stats-label {
        color: #ffffff !important;
        font-size: 14px;
        display: block !important;
        opacity: 0.9;
        margin-top: 5px;
    }
    
    .stats-number {
        font-size: 1.8rem; /* Make numbers pop */
    }

    /* Mobile Card Adjustments */
    .result-box {
        padding: 1.5rem !important;
    }
    
    /* 🚨 Mobile Ring Size Fix */
    .score-pro-ring {
        width: 180px;  /* Increased mobile size */
        height: 180px;
    }
    .score-inner-circle h2 {
        font-size: 2.2rem !important; 
        margin-bottom: 0;
    }
}

/* Stats & Trust Badges Styling */
.ls-1 {
    letter-spacing: 1px;
    font-weight: 600;
}
.opacity-50 {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.opacity-50:hover {
    opacity: 1; /* Brightens logos on hover */
}

/* Customer Feedback Avatars */
.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover; /* Ensures image doesn't distort */
}
/* Risk Label Styling inside Ring */
.score-inner-circle p {
    font-size: 0.9rem; 
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* Mobile fix for Risk Label */
@media (max-width: 768px) {
    .score-inner-circle p {
        font-size: 0.8rem !important;
    }
}