/* ===== VARIABLES ===== */
:root {
    --color-primary: #0DDF7A;
    --color-primary-light: #B3FBD8;
    --color-dark: #111111;
    --color-dark-light: #1a1a1a;
    --color-dark-lighter: #2a2a2a;
    --color-text: #ffffff;
    --color-text-secondary: #b0b0b0;
    --color-facebook: #1877f2;
    --color-google: #ea4335;
    --color-success: #0DDF7A;
    --color-warning: #ffc107;
    --font-primary: 'Inter', sans-serif;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(13, 223, 122, 0.3);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== HEADER ===== */
.dashboard-header {
    background: var(--color-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    height: 35px;
}

.client-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-selector label {
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

#client-select {
    background: var(--color-dark-lighter);
    color: var(--color-text);
    border: 1px solid rgba(13, 223, 122, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 300px;
}


.btn-presentation {
    background: var(--color-dark-lighter);
    color: var(--color-primary);
    border: 1px solid rgba(13, 223, 122, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-presentation:hover {
    background: rgba(13, 223, 122, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(13, 223, 122, 0.2);
}

/* Presentation Mode Styles */
body.presentation-mode .dashboard-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

body.presentation-mode .dashboard-footer {
    display: none;
}

body.presentation-mode .dashboard-main {
    padding-top: 2rem;
}

.presentation-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    z-index: 1000;
}

body.presentation-mode .presentation-controls {
    display: flex;
    gap: 1rem;
}

.btn-exit-presentation {
    background: var(--color-primary);
    color: var(--color-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
}

.btn-exit-presentation:hover {
    transform: scale(1.05);
}

.btn-exit-presentation:hover {
    transform: scale(1.05);
}

.mini-selector {
    background: var(--color-dark);
    color: var(--color-text);
    border: 1px solid var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
}

#client-select:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(13, 223, 122, 0.2);
}

#client-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

/* ===== MAIN CONTENT ===== */
.dashboard-main {
    padding: 3rem 0;
}

.client-info {
    margin-bottom: 3rem;
    text-align: center;
}

.client-info h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.client-info p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--color-primary);
    font-size: 1.3rem;
}

/* ===== INVESTMENT SECTION ===== */
.investment-section {
    margin-bottom: 3rem;
}

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

.metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(13, 223, 122, 0.3);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.metric-card.facebook .card-icon {
    background: linear-gradient(135deg, var(--color-facebook), #145dbf);
    color: white;
}

.metric-card.google .card-icon {
    background: linear-gradient(135deg, var(--color-google), #c5221f);
    color: white;
}

.metric-card.total .card-icon {
    background: linear-gradient(135deg, var(--color-primary), #0ab060);
    color: var(--color-dark);
}

.card-content {
    flex: 1;
}

.card-label {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card-value {
    color: var(--color-text);
    font-size: 1.8rem;
    font-weight: 800;
}

/* ===== MAIN GRID (Funnel + KPIs) ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ===== FUNNEL SECTION ===== */
.funnel-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}

.funnel-stage {
    position: relative;
    background: linear-gradient(90deg, rgba(13, 223, 122, 0.1), rgba(13, 223, 122, 0.05));
    border: 1px solid rgba(13, 223, 122, 0.3);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    margin: 0 auto;
    width: 100%;
}

.funnel-stage:hover {
    background: linear-gradient(90deg, rgba(13, 223, 122, 0.15), rgba(13, 223, 122, 0.08));
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(13, 223, 122, 0.2);
}

.funnel-stage-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.funnel-stage-value {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.funnel-stage-percent {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    background: var(--color-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.funnel-arrow {
    text-align: center;
    color: var(--color-primary);
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* Width progression for visual funnel effect */
.funnel-stage:nth-child(1) {
    max-width: 100%;
}

.funnel-stage:nth-child(3) {
    max-width: 90%;
}

.funnel-stage:nth-child(5) {
    max-width: 78%;
}

.funnel-stage:nth-child(7) {
    max-width: 66%;
}

.funnel-stage:nth-child(9) {
    max-width: 54%;
}

.funnel-stage:nth-child(11) {
    max-width: 45%;
}

/* Follow-up Badge (outside main funnel) */
.funnel-followup-badge {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    transition: all 0.3s ease;
}

.funnel-followup-badge:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.08));
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.2);
}

.funnel-followup-badge i {
    font-size: 1.5rem;
    color: #ffc107;
}

.followup-label {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.followup-value {
    font-weight: 700;
    color: #ffc107;
    font-size: 1.25rem;
}

/* ===== KPI SECTION ===== */
.kpi-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(13, 223, 122, 0.3);
}

.kpi-card.highlight {
    border-color: rgba(13, 223, 122, 0.5);
    background: linear-gradient(135deg, rgba(13, 223, 122, 0.1), rgba(13, 223, 122, 0.05));
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), #0ab060);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== BOTTOM CONTENT (METRICS + TABLE) ===== */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.ad-metrics-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.ad-metric-card .metric-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.metric-label {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0px;
}

.metric-sublabel {
    font-size: 0.75rem;
    opacity: 0.7;
}

.metric-big-value {
    margin-left: auto;
    font-weight: 800;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.creative-table-wrapper {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.creative-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.creative-table th {
    text-align: left;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.creative-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.creative-table tr:last-child td {
    border-bottom: none;
}

.table-creative-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-creative-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.table-creative-name {
    font-weight: 600;
    color: var(--color-text);
}

.table-creative-platform {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
}

.table-ctr {
    color: var(--color-primary);
    font-weight: 700;
}

.table-leads {
    color: var(--color-text);
    font-weight: 700;
}

.table-spend {
    color: var(--color-text-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card,
.kpi-card,
.funnel-stage,
.ad-metric-card,
.creative-table tr {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== FOOTER ===== */
.dashboard-footer {
    background: var(--color-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    #client-select {
        min-width: 100%;
    }

    .client-info h1 {
        font-size: 1.8rem;
    }

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

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

    .card-value {
        font-size: 1.5rem;
    }
}