/* --------------------------------------------------------------------------
   THEME VARIABLES (LIGHT & DARK MODE) - RED DEBUG THEME
   -------------------------------------------------------------------------- */

:root {
    /* ☀️ LIGHT MODE (Red) */
    --dg-text-main: #2F1A1A; /* Dark crimson/brown for text */
    --dg-tea-dark: #D32F2F;  /* Main Red */
    --dg-tea-light: #EF5350; /* Lighter Red */
    
    /* Background Gradient */
    --dg-bg-light: #FFEBEE; /* Very pale red tint */
    --dg-bg-accent: #FFCDD2; /* Slightly deeper pale red */
    
    /* True High-End Glassmorphism */
    --dg-glass-bg: rgba(255, 255, 255, 0.75); 
    --dg-glass-border: rgba(255, 255, 255, 0.9);
    --dg-shadow: 0 16px 40px rgba(211, 47, 47, 0.15); 
    
    /* UI Icons */
    --dg-icon-color: #5c4b4b;

    /* Glassbleed Tier Anchors */
    --dg-ultra-gold: #D4AF37;
    --dg-free-border: rgba(100, 100, 100, 0.2);
    --dg-free-bleed: rgba(100, 100, 100, 0.05);
}

body.dg-dark-theme {
    /* 🌙 DARK MODE (Red) */
    --dg-text-main: #FFEBEE; 
    --dg-tea-dark: #D32F2F;  
    --dg-tea-light: #EF5350; 
    
    /* Background Gradient */
    --dg-bg-light: #120B0B; 
    --dg-bg-accent: #241616; 
    
    /* Dark Mode Glassmorphism */
    --dg-glass-bg: rgba(30, 20, 20, 0.75); 
    --dg-glass-border: rgba(255, 255, 255, 0.08);
    --dg-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); 
    
    /* UI Icons */
    --dg-icon-color: #AFA3A3;

    /* Dark Tier Anchors */
    --dg-free-border: rgba(255, 255, 255, 0.1);
    --dg-free-bleed: rgba(255, 255, 255, 0.03);
}

/* --------------------------------------------------------------------------
   THE GLOBAL GLASSBLEED COMPONENT
   -------------------------------------------------------------------------- */

.glassbleed {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dg-bleed-border, var(--dg-free-border)) !important;
    background: linear-gradient(180deg, var(--dg-bleed-color, var(--dg-free-bleed)) 0%, rgba(0, 0, 0, 0) 100%) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.4s ease, background 0.4s ease;
}

body.dg-dark-theme .glassbleed {
    background: linear-gradient(180deg, var(--dg-bleed-color, var(--dg-free-bleed)) 0%, rgba(20, 20, 20, 0.6) 100%) !important;
}

/* --- TIER CONFIGURATIONS --- */

/* 1. FREE TIER (Neutral) */
.dg-card-free {
    --dg-bleed-border: var(--dg-free-border);
    --dg-bleed-color: var(--dg-free-bleed);
}

/* 2. PREMIUM TIER (Softened) */
.dg-card-premium {
    --dg-bleed-border: rgba(211, 47, 47, 0.3);
    /* Increased to 10% opacity red */
    --dg-bleed-color: rgba(211, 47, 47, 0.10);
}
body.dg-dark-theme .dg-card-premium {
    --dg-bleed-border: rgba(211, 47, 47, 0.5);
    /* Increased to 15% opacity red */
    --dg-bleed-color: rgba(211, 47, 47, 0.15); 
}


/* 3. ULTRA TIER (Intensified Gold) */
.dg-card-ultra {
    --dg-bleed-border: rgba(212, 175, 55, 0.8);
    /* Increased from 5% to a rich 15% opacity gold */
    --dg-bleed-color: rgba(212, 175, 55, 0.15); 
}
body.dg-dark-theme .dg-card-ultra {
    --dg-bleed-border: rgba(212, 175, 55, 0.6);
    /* Increased to a glowing 25% opacity gold */
    --dg-bleed-color: rgba(212, 175, 55, 0.25); 
}


/* --------------------------------------------------------------------------
   THEME OVERRIDES
   -------------------------------------------------------------------------- */

body, html {
    background: linear-gradient(135deg, var(--dg-bg-light) 0%, var(--dg-bg-accent) 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ... keep your other layout and component CSS here ... */

    header.entry-header, .ast-single-entry-header, .ast-page-header {
        display: none !important;
    }

    #page, .site, .site-content, .ast-container, .site-main, .entry-content, .ast-plain-container {
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* --------------------------------------------------------------------------
       DIGIVITE CORE LAYOUT
       -------------------------------------------------------------------------- */

    .digivite-page {
        background: transparent !important; 
        min-height: 100vh;
        padding-bottom: 60px;
        color: var(--dg-text-main);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        transition: color 0.4s ease; /* Smooth text color change */
    }

    .digivite-container {
        max-width: 1080px;
        margin: 0 auto;
        padding: 40px 20px;
    }

    .digivite-card, .digivite-header {
        background: var(--dg-glass-bg) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border: 1px solid var(--dg-glass-border) !important;
        border-radius: 24px;
        box-shadow: var(--dg-shadow) !important;
        transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    }

    .digivite-card {
        padding: 32px;
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
        opacity: 0;
        animation: dgFadeInUp 0.6s ease-out forwards;
    }

    /* Stagger the card animations */
    .digivite-grid .digivite-card:nth-child(1) { animation-delay: 0.1s; }
    .digivite-grid .digivite-card:nth-child(2) { animation-delay: 0.2s; }
    .digivite-grid .digivite-card:nth-child(3) { animation-delay: 0.3s; }
    .digivite-grid .digivite-card:nth-child(4) { animation-delay: 0.4s; }

    .digivite-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 24px 56px rgba(211, 47, 47, 0.2) !important; /* Updated to Red Shadow */
    }

    /* --------------------------------------------------------------------------
       HEADER NAVIGATION
       -------------------------------------------------------------------------- */

    .digivite-header {
        opacity: 0;
        animation: dgFadeInDown 0.6s ease-out forwards;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 24px;
        margin: 16px 0 32px 0;
    }

    .dg-header-links {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .dg-header-links a {
        color: var(--dg-text-main);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.95rem;
        transition: all 0.3s ease;
    }

    .dg-header-links a:hover {
        color: var(--dg-tea-dark);
        transform: translateY(-2px);
    }

    .dg-header-actions {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .dg-logo {
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--dg-text-main);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dg-logo-text {
        background: -webkit-linear-gradient(135deg, var(--dg-tea-dark), var(--dg-tea-light));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .dg-header-icon {
        color: var(--dg-tea-dark);
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: var(--dg-glass-bg);
        border: 1px solid var(--dg-glass-border);
        transition: all 0.3s ease;
        box-shadow: var(--dg-shadow);
    }

    .dg-header-icon:hover {
        transform: scale(1.05);
    }

    /* --------------------------------------------------------------------------
       COMPONENTS
       -------------------------------------------------------------------------- */

    .digivite-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 14px 28px;
        background: linear-gradient(135deg, var(--dg-tea-dark), var(--dg-tea-light));
        color: #fff !important;
        font-weight: 600;
        text-decoration: none;
        border-radius: 50px;
        border: none;
        cursor: pointer;
        box-shadow: 0 8px 20px rgba(211, 47, 47, 0.3); /* Updated to Red Shadow */
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        opacity: 0;
        animation: dgPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        animation-delay: 0.4s;
    }

    .digivite-btn:hover {
        box-shadow: 0 12px 28px rgba(211, 47, 47, 0.4); /* Updated to Red Shadow */
        transform: translateY(-3px) scale(1.05);
    }

    .digivite-btn-outline {
        background: rgba(255, 255, 255, 0.1); 
        color: var(--dg-tea-dark) !important;
        border: 2px solid var(--dg-tea-dark);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: none;
    }

    .digivite-btn-outline:hover {
        background: var(--dg-tea-dark);
        color: #fff !important;
        box-shadow: 0 8px 20px rgba(211, 47, 47, 0.3); /* Updated to Red Shadow */
    }

    .digivite-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }

    .digivite-page-head {
        text-align: center;
        margin-bottom: 48px;
        opacity: 0;
        animation: dgFadeInUp 0.7s ease-out forwards;
        animation-delay: 0.1s;
    }

    .digivite-page-head h1 {
        font-size: 2.5rem;
        font-weight: 800;
        margin-bottom: 12px;
        color: var(--dg-text-main);
    }

    .digivite-page-head p {
        color: var(--dg-text-main);
        opacity: 0.8;
        font-size: 1.1rem;
    }

    /* --------------------------------------------------------------------------
       FORM INPUT STYLES
       -------------------------------------------------------------------------- */

    .digivite-form-group {
        margin-bottom: 20px;
        text-align: left;
    }

    .digivite-form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--dg-text-main);
    }

    .digivite-input {
        width: 100%;
        padding: 14px 16px;
        border-radius: 12px;
        border: 2px solid var(--dg-glass-border);
        background: var(--dg-glass-bg); 
        color: var(--dg-text-main);
        font-size: 1rem;
        transition: all 0.3s ease;
        box-sizing: border-box;
        font-family: inherit;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .digivite-input:focus {
        outline: none;
        border-color: var(--dg-tea-dark);
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.15); /* Updated to Red Glow */
    }

    /* --------------------------------------------------------------------------
       CREATE PAGE UI REFINEMENTS
       -------------------------------------------------------------------------- */

    .dg-sub-filter {
        font-size: 0.8rem;
        padding: 6px 14px;
        border-radius: 50px;
        background: rgba(128, 128, 128, 0.1); 
        color: var(--dg-text-main);
        text-decoration: none !important;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .dg-sub-filter.active, 
    .dg-sub-filter:hover {
        background: var(--dg-tea-dark);
        color: #ffffff !important;
    }

    .dg-btn-ultra {
        border-color: #D4AF37 !important;
        color: #D4AF37 !important;
    }

    .dg-btn-ultra.active {
        background: #222 !important;
        color: #D4AF37 !important;
        border: 2px solid #D4AF37 !important;
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2) !important;
    }

    .dg-btn-ultra:hover {
        background: #D4AF37 !important;
        color: #222 !important;
    }

    .dg-template-card {
        padding: 0 !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .dg-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
        border-radius: 50px;
        font-weight: 700;
    }
    
    .dg-badge-free {
        background: rgba(100, 100, 100, 0.1); /* Neutral Gray for free */
        color: #666666;
    }
    body.dg-dark-theme .dg-badge-free { color: #aaaaaa; }
    
    .dg-badge-premium {
        background: rgba(211, 47, 47, 0.1); /* Red for premium */
        color: var(--dg-tea-dark);
    }
    
    .dg-badge-ultra {
        background: rgba(212, 175, 55, 0.1); /* Gold for ultra */
        color: #D4AF37;
    }

    .dg-no-preview {
        background: rgba(211, 47, 47, 0.05); /* Red tint */
        color: var(--dg-tea-dark);
        border-bottom: 1px solid var(--dg-glass-border);
    }

    .dg-btn-action {
        flex: 1;
        padding: 10px 4px !important;
        font-size: 0.85rem !important;
        text-align: center;
    }

    .dg-btn-selected {
        background: var(--dg-bg-accent);
        color: var(--dg-tea-dark);
        border-radius: 50px;
        font-weight: bold;
        border: 2px solid var(--dg-bg-accent);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dg-btn-buy-ultra {
        background: #222 !important;
        color: #D4AF37 !important;
        border: 1px solid #222 !important;
    }

    .dg-btn-buy-ultra:hover {
        background: #D4AF37 !important;
        color: #222 !important;
    }

    /* --------------------------------------------------------------------------
       KEYFRAME ANIMATIONS
       -------------------------------------------------------------------------- */

    @keyframes dgFadeInUp {
        0% { opacity: 0; transform: translateY(30px); }
        100% { opacity: 1; transform: translateY(0); }
    }

    @keyframes dgFadeInDown {
        0% { opacity: 0; transform: translateY(-20px); }
        100% { opacity: 1; transform: translateY(0); }
    }

    @keyframes dgPopIn {
        0% { opacity: 0; transform: scale(0.9); }
        100% { opacity: 1; transform: scale(1); }
    }

    /* --------------------------------------------------------------------------
       MOBILE RESPONSIVENESS
       -------------------------------------------------------------------------- */

    @media (max-width: 768px) {
        .digivite-container { padding: 20px 12px; }
        .digivite-card { padding: 24px 16px; }
        .digivite-header {
            padding: 12px 16px !important;
            margin-bottom: 24px !important;
            margin-top: 12px !important;
            border-radius: 20px !important;
        }
        .digivite-btn { padding: 12px 20px; font-size: 0.9rem; }
        .digivite-page-head h1 { font-size: 2rem; }
        .dg-header-links, .dg-header-logout { display: none !important; }
    }

