/* =========================================
   DEMOGRAPHICS PAGE STYLES
   ========================================= */

/* --- 1. MASTER WRAPPER --- */
.demo-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    gap: 20px;
    box-sizing: border-box;
}

/* --- 2. LEFT COLUMN (Content) --- */
.demo-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

/* --- 3. RIGHT COLUMN (Ad) --- */
.demo-right {
    width: 140px;
    flex-shrink: 0;
    position: sticky;
    top: 15px;
    z-index: 5;
}

/* --- 4. SHARED GLASS BOX STYLE --- */
.glass-box {
    background: var(--logo-color);
    border: 1px solid var(--logo-color);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* --- 5. QUESTION SECTION --- */
.question-box {
    padding: 20px 25px;
}

.question-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #fff;
}

/* --- 6. VOTING & CONTROLS --- */
.details-vote-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

/* --- 7. FILTER TABS --- */
.demo-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.demo-tab {
    padding: 6px 14px;
    border: 1px solid var(--logo-color);
    border-radius: 20px;
    background: var(--white-color);
    color: var(--logo-color);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.demo-tab:hover {
    background: var(--logo-color);
    color: var(--white-color);
    border-color: var(--logo-color);
}

.demo-tab.active {
    background: var(--logo-color);
    color: var(--white-color);
    border-color: var(--logo-color);
    box-shadow: none;
}

/* --- 8. CHARTS CONTAINER --- */
.demo-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: start;
}

.demo-chart-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-chart-card h3 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: var(--logo-color);
}

.sub {
    font-size: 0.75rem;
    color: var(--logo-color);
    margin-bottom: 10px;
    display: block;
}

/* --- 9. PIE CHARTS --- */
.pie {
    --size: 100px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    margin: 5px auto;
    background: conic-gradient(var(--logo-color) 0% calc(var(--p) * 1%),
            var(--black-color) calc(var(--p) * 1%) 100%);
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.15);
    position: relative;
}

.pie::after {
    content: "";
    position: absolute;
    inset: 20px;
    /* Donut Hole Size */
    background: var(--white-color);
    /* Match background color */
    border-radius: 50%;
}

.result-text {
    font-weight: 700;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #fff;
}

/* --- 10. AD BOX STYLING --- */
.ad-box {
    width: 100%;
    height: 400px;

    /* Dark Transparent Background with subtle Gradient */
    background: var(--logo-color);

    /* Neon Dashed Border */
    border: 1px dashed var(--logo-color);
    border-radius: 12px;

    /* Text Styling */
    color: var(--white-color);
    /* Neon Green Text */
    font-family: 'Courier New', Courier, monospace;
    /* Tech/Code Font */
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 5px;
    /* Spaced out letters */
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--logo-color);
    /* Glowing Text */

    /* Alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    /* Vertical Text */
    text-orientation: upright;
    /* Letters stand upright */

    /* Smooth Transition */
    transition: all 0.3s ease;
    cursor: default;
}

/* Hover Effect - Makes it feel "active" */
.ad-box:hover {
    color: var(--logo-color);
    border-color: var(--white-color);
    /* Bright border on hover */
    background: var(--white-color);
    /* Slightly brighter background */
    box-shadow: 0 0 20px var(--white-color);
    /* Green Glow */
    cursor: pointer;
}

/* --- 11. SHARE SECTION --- */
.share-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--white-color);
    /* Subtle divider */
}

.share-label {
    font-weight: 600;
    color: var(--logo-color);
    margin-right: 5px;
}

.share-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Brand Colors */
.share-btn.twitter {
    background: #000;
    border: 1px solid #333;
}

.share-btn.twitter:hover {
    background: #333;
}

.share-btn.facebook {
    background: #4267B2;
}

.share-btn.facebook:hover {
    background: #365899;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
}

.share-btn.instagram:hover {
    opacity: 0.9;
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.whatsapp:hover {
    background: #128C7E;
}

.share-btn.email {
    background: #EA4335;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
}

.share-btn.email:hover {
    background: #d93025;
    box-shadow: 0 5px 15px rgba(234, 67, 53, 0.4);
}

/* Hide all chart groups by default */
.chart-group {
    display: none;
}

.chart-group.active-group {
    display: grid;
    /* This creates exactly 3 equal columns. A single card will only take up 1/3 of the space */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.demo-chart-card {
    width: 100%;
    /* Ensure it fills its specific grid column, but no more */
    /* Make sure to REMOVE "flex: 1;" if you still have it here */
    /* ... keep your background, border, etc. */
}

/* =========================================
   RESPONSIVE MEDIA
   ========================================= */

/* Tablet & Mobile Breakpoint (Below 900px) */
@media (max-width: 900px) {
    .demo-wrapper {
        flex-direction: column;
        padding: 10px;
    }

    .demo-left {
        width: 100%;
    }

    /* Move Ad to Bottom */
    .demo-right {
        width: 100%;
        position: static;
        margin-top: 10px;
    }

    .ad-box {
        writing-mode: horizontal-tb;
        height: 80px;
        letter-spacing: 2px;
    }
}

/* Mobile Specific (Below 500px) */
@media (max-width: 500px) {
    .question-title {
        font-size: 1.1rem;
    }

    .demo-charts {
        grid-template-columns: 1fr;
        /* Stack charts */
    }
}