/* CSS Stylesheet for Umoney Ads Dashboard */
:root {
    --primary: #ff6600;
    --primary-light: #ffedd5;
    --primary-hover: #e65c00;
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logo-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.brand-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-logo-umoney {
    height: 28px;
    object-fit: contain;
}

.divider-line {
    width: 1px;
    height: 24px;
    background-color: var(--border);
}

.brand-logo-fooogle {
    height: 24px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.25);
}

.nav-item i {
    font-size: 1.15rem;
    width: 24px;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 3rem;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.header-title h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.date-badge {
    background-color: var(--primary-light);
    border: 1px solid rgba(255, 102, 0, 0.2);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cover Page */
.cover-container {
    background: linear-gradient(135deg, #fffcf9 0%, #fff7ed 100%);
    border-radius: 20px;
    padding: 5rem 4rem;
    border: 1px solid rgba(255, 102, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 65vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(255, 102, 0, 0.05);
}

.cover-decor {
    position: absolute;
    right: -100px;
    top: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.08) 0%, rgba(255, 102, 0, 0) 70%);
    border-radius: 50%;
}

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

.cover-right-logo {
    position: absolute;
    right: 15px;
    top: 10px;
    width: 70px;
    height: 70px;
    object-fit: contain;
    z-index: 5;
    mix-blend-mode: multiply;
}

.cover-body {
    max-width: 750px;
    z-index: 2;
}

.cover-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.cover-title {
    font-size: 3rem;
    font-weight: 850;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.cover-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.cover-meta {
    display: flex;
    gap: 4rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.meta-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.meta-item strong {
    font-size: 1.05rem;
    color: var(--text-main);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(255, 102, 0, 0.05);
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.75rem 0 0.25rem 0;
}

.kpi-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-trend {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.up {
    color: var(--success);
}

.kpi-trend.down {
    color: var(--danger);
}

/* Table */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.table-header-area {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.table-header-area h3 {
    font-size: 1.1rem;
    font-weight: 750;
    color: var(--text-main);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.5px;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-main);
}

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

tr:hover td {
    background-color: #fcfcfc;
}

tr.sum-row td {
    font-weight: 800;
    background-color: var(--primary-light);
    color: var(--primary);
    border-top: 1px solid rgba(255, 102, 0, 0.2);
}

.badge {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.paused {
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge.evaluation {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.badge.evaluation.good {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge.evaluation.caution {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.chart-card h3 {
    font-size: 1.05rem;
    font-weight: 750;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Recommendations */
.rec-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.rec-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.rec-card h3 {
    font-size: 1.1rem;
    font-weight: 750;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rec-card h3.strengths { color: var(--success); }
.rec-card h3.weaknesses { color: var(--danger); }
.rec-card h3.actions { color: var(--primary); }
.rec-card h3.conclusions { color: var(--text-main); }

.rec-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rec-list li i {
    margin-top: 3px;
    font-size: 0.85rem;
}

.rec-list.strengths li i { color: var(--success); }
.rec-list.weaknesses li i { color: var(--danger); }
.rec-list.actions li i { color: var(--primary); }

.conclusion-text {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-main);
}

/* Responsive */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .rec-container { grid-template-columns: 1fr; }
}

.download-pdf-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.2);
}

.download-pdf-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Print styles */
@media print {
    html, body {
        background-color: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
    .sidebar, .download-pdf-btn, .date-badge i, .modal, .close {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem !important;
        width: 100% !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
    header {
        margin-bottom: 2rem !important;
        border-bottom: 1px solid #000000 !important;
        padding-bottom: 1rem !important;
    }
    .date-badge {
        background-color: transparent !important;
        border: none !important;
        color: #000000 !important;
        padding: 0 !important;
        font-weight: bold !important;
    }
    .tab-content {
        display: block !important; /* Show all sections sequentially for printing */
        page-break-after: always !important;
        break-after: page !important;
        height: auto !important;
        overflow: visible !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    /* Hide Trang Bìa header icon or adjust layout */
    .cover-container {
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        min-height: 85vh !important;
        height: auto !important;
        overflow: visible !important;
    }
    .cover-decor {
        display: none !important;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .chart-grid {
        grid-template-columns: 1fr !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .rec-container {
        grid-template-columns: 1fr !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .table-container {
        page-break-inside: auto !important;
        break-inside: auto !important;
        overflow: visible !important;
    }
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    div {
        overflow: visible !important;
    }
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}


/* New Badge styles for Objectives */
.badge.obj-badge {
    text-transform: none;
    font-size: 0.8rem;
    padding: 4px 12px;
}
.badge.obj-badge.followers {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.badge.obj-badge.kyc-app-install {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge.obj-badge.app-action {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Code Badge styling */
.code-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 102, 0, 0.15);
}

/* Thumbnail image in table */
.ad-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ad-thumbnail:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 50;
}

.num-col {
    text-align: right;
}

/* Lightbox Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    border: 3px solid #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.close {
    position: absolute;
    top: 40px;
    right: 45px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}
}
