﻿/* Dashboard Container */
.dashboard-container {
    padding: 1rem;
    min-height: 100vh;
}

/* Header Section */
.header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    text-align: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 2rem;
    margin: 0 0 1rem 0;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(120deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 300;
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

    .filter-header h3 {
        font-size: 1rem;
        color: #2c3e50;
        margin: 0;
        font-weight: 600;
    }

.filter-reset-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .filter-reset-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }

.filter-body {
    width: 100%;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.filter-select {
    padding: 0.7rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2c3e50;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

    .filter-select:hover {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    }

    .filter-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

/* KPI Section */
.kpi-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 5px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border-left: 5px solid transparent;
}

    .kpi-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    }

    .kpi-card:nth-child(1) {
        border-left-color: #FF6B6B;
    }

    .kpi-card:nth-child(2) {
        border-left-color: #4ECDC4;
    }

    .kpi-card:nth-child(3) {
        border-left-color: #FFE66D;
    }

    .kpi-card:nth-child(4) {
        border-left-color: #95E1D3;
    }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.kpi-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 10px;
}

    .kpi-icon.budget {
        background: rgba(255, 107, 107, 0.1);
    }

    .kpi-icon.revenue {
        background: rgba(78, 205, 196, 0.1);
    }

    .kpi-icon.roi {
        background: rgba(255, 230, 109, 0.1);
    }

    .kpi-icon.roas {
        background: rgba(149, 225, 211, 0.1);
    }

.kpi-content h4 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.kpi-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.kpi-footer {
    margin-top: 1.5rem;
}

.kpi-detail {
    display: block;
    color: #95a5a6;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.kpi-progress {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Charts Section */
.charts-section {
    margin-bottom: 3rem;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 5px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

    .chart-card:hover {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    }

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
}

.chart-canvas {
    max-height: 220px;
}

.no-data {
    color: #95a5a6;
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
}

/* Insights Section */
.insights-section {
    margin-bottom: 3rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.insight-card {
    background: white;
    border-radius: 5px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid #667eea;
}

    .insight-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    }

.insight-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.insight-icon {
    font-size: 2rem;
}

.insight-header h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.insight-content {
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.insight-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin: 0.5rem 0;
}

.insight-detail {
    color: #95a5a6;
    font-size: 0.85rem;
    margin: 0;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.table-header {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

    .table-header .section-title {
        color: white;
        font-size: 1.2rem;
        margin-bottom: 0;
    }

.table-container {
    overflow-x: auto;
}

.campaign-table {
    width: 100%;
    border-collapse: collapse;
}

    .campaign-table thead th {
        background: #f8f9fa;
        padding: 1.5rem;
        text-align: left;
        font-weight: 600;
        color: #2c3e50;
        font-size: 0.8rem;
        border-bottom: 2px solid #ecf0f1;
    }

    .campaign-table tbody td {
        padding: 1rem;
        border-bottom: 1px solid #ecf0f1;
        font-size: 0.8rem;
    }

    .campaign-table tbody tr {
        transition: all 0.2s ease;
    }

        .campaign-table tbody tr:hover {
            background: #f8f9fa;
        }

.channel-tag {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

    .channel-tag.facebook {
        background: rgba(59, 89, 152, 0.1);
        color: #3b5998;
    }

    .channel-tag.google {
        background: rgba(234, 67, 53, 0.1);
        color: #ea4335;
    }

    .channel-tag.instagram {
        background: rgba(225, 48, 108, 0.1);
        color: #e14770;
    }

    .channel-tag.twitter {
        background: rgba(29, 161, 242, 0.1);
        color: #1da1f2;
    }

    .channel-tag.amazon {
        background: rgba(255, 153, 0, 0.1);
        color: #ff9900;
    }

/* Metric Highlight */
.metric-highlight {
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    display: inline-block;
    font-size: 0.9rem;
}

    .metric-highlight.roi-high,
    .metric-highlight.roas-high {
        background: rgba(76, 175, 80, 0.1);
        color: #4caf50;
    }

    .metric-highlight.roi-medium,
    .metric-highlight.roas-medium {
        background: rgba(255, 193, 7, 0.1);
        color: #ffc107;
    }

    .metric-highlight.roi-low,
    .metric-highlight.roas-low {
        background: rgba(244, 67, 54, 0.1);
        color: #f44336;
    }

/* Text Utilities */
.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 1.8rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .header-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }

    .dashboard-subtitle {
        font-size: 0.9rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-reset-btn {
        width: 100%;
    }

    .campaign-table {
        font-size: 0.85rem;
    }

        .campaign-table thead th,
        .campaign-table tbody td {
            padding: 0.8rem;
        }
}

@media (max-width: 480px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 1rem;
    }

    .kpi-card {
        padding: 1.5rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card,
.chart-card,
.insight-card {
    animation: fadeIn 0.6s ease forwards;
}

    .kpi-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .kpi-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .kpi-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .kpi-card:nth-child(4) {
        animation-delay: 0.4s;
    }

/* Print Styles */
@media print {
    .dashboard-container {
        background: white;
    }

    .chart-card {
        page-break-inside: avoid;
    }
}


.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 5px 14px;
    border-radius: 8px;
    border: 1px solid #d0d7e2;
    background: linear-gradient(135deg, #ffffff, #f3f6fb);
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .page-btn:hover {
        background: linear-gradient(135deg, #4f46e5, #6366f1);
        color: #fff;
        transform: translateY(-1px);
    }

    .page-btn.active {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 6px 15px rgba(34,197,94,0.35);
    }

    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }
