/**
 * DASHBOARD GOOGLE SEARCH CONSOLE AVANCÉ
 * Styles pour l'interface ultra-puissante GSC
 */

.gsc-dashboard {
    padding: 2rem 0;
    background: var(--background-light);
    min-height: calc(100vh - 400px);
}

.gsc-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    contain: layout style paint;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gsc-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gsc-section:last-child {
    margin-bottom: 0;
}

.gsc-section h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 2rem;
    margin-top: 0;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 1.2rem;
    border-bottom: 3px solid #e8eaed;
    background: linear-gradient(135deg, #1A5DC9 0%, #3d7edb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.gsc-section-subtitle {
    color: var(--text-color-medium);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.gsc-section h3 {
    font-size: 1.3rem;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
    margin-top: 0;
    font-weight: 700;
}

.gsc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.gsc-metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.gsc-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1A5DC9, #3d7edb);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gsc-metric-card:hover {
    border-color: #1A5DC9;
    box-shadow: 0 8px 24px rgba(26, 93, 201, 0.15);
    transform: translateY(-4px);
}

.gsc-metric-card:hover::before {
    opacity: 1;
}

.gsc-metric-card.highlight {
    background: linear-gradient(135deg, #1A5DC9 0%, #3d7edb 50%, #5a9ef0 100%);
    color: #ffffff;
    border-color: #1A5DC9;
    box-shadow: 0 8px 24px rgba(26, 93, 201, 0.25);
}

.gsc-metric-card.highlight::before {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    height: 100%;
    width: 100%;
    top: 0;
}

.gsc-metric-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    display: block;
}

.gsc-metric-value {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    letter-spacing: -1px;
    line-height: 1.1;
}

.gsc-metric-card.highlight .gsc-metric-value {
    color: var(--white);
}

.gsc-metric-label {
    font-size: 0.9rem;
    color: var(--text-color-medium);
}

.gsc-metric-card.highlight .gsc-metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.gsc-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    contain: layout style;
}

.gsc-chart-card {
    background: var(--background-light);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    position: relative;
    height: 450px;
    overflow: hidden;
    contain: layout style paint;
    will-change: auto;
}

.gsc-chart-card canvas {
    max-height: 400px !important;
    height: 400px !important;
    width: 100% !important;
}

.gsc-chart-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color-dark);
}

.gsc-chart-card canvas {
    max-height: 300px;
}

/* Opportunités */
.gsc-opportunities-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gsc-opportunity-card {
    background: var(--background-light);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    border-left: 4px solid;
    transition: box-shadow 0.2s ease;
    will-change: auto;
}

.gsc-opportunity-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.gsc-opportunity-card.critical {
    border-left-color: var(--red-dark);
}

.gsc-opportunity-card.high {
    border-left-color: var(--orange-dark);
}

.gsc-opportunity-card.medium {
    border-left-color: var(--blue-dark);
}

.gsc-opportunity-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gsc-opportunity-rank {
    background: var(--primary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.gsc-opportunity-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gsc-opportunity-type {
    font-size: 1.5rem;
}

.gsc-opportunity-badge {
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.gsc-opportunity-badge.critical {
    background: var(--red-light);
    color: var(--red-dark);
}

.gsc-opportunity-badge.high {
    background: var(--orange-light);
    color: var(--orange-dark);
}

.gsc-opportunity-badge.medium {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.gsc-opportunity-body {
    margin-top: 1rem;
}

.gsc-opportunity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.gsc-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.gsc-stat-label {
    font-size: 0.85rem;
    color: var(--text-color-medium);
}

.gsc-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color-dark);
}

.gsc-stat-value.highlight {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.gsc-opportunity-action {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--primary-color);
    font-size: 0.95rem;
    color: var(--text-color-dark);
}

/* Tendances */
.gsc-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.gsc-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color-medium);
    transition: var(--transition-ease);
    margin-bottom: -2px;
}

.gsc-tab:hover {
    color: var(--primary-color);
}

.gsc-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.gsc-tab-content {
    display: none;
}

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

.gsc-trends-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.gsc-trend-card {
    background: var(--background-light);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    border-left: 4px solid;
}

.gsc-trend-card.growing {
    border-left-color: var(--green-dark);
}

.gsc-trend-card.declining {
    border-left-color: var(--red-dark);
}

.gsc-trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.gsc-trend-query {
    font-weight: 700;
    color: var(--text-color-dark);
    flex: 1;
}

.gsc-trend-growth {
    font-weight: 800;
    font-size: 1.1rem;
}

.gsc-trend-card.growing .gsc-trend-growth {
    color: var(--green-dark);
}

.gsc-trend-card.declining .gsc-trend-growth {
    color: var(--red-dark);
}

.gsc-trend-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color-medium);
    flex-wrap: wrap;
}

.gsc-trend-change {
    font-weight: 700;
    color: var(--text-color-dark);
}

/* Top Lists */
.gsc-two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.gsc-top-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.gsc-top-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
}

.gsc-top-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #1A5DC9, #3d7edb);
    border-radius: 12px 0 0 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gsc-top-item:hover {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(26, 93, 201, 0.12);
    border-color: rgba(26, 93, 201, 0.2);
    transform: translateX(6px) translateY(-2px);
}

.gsc-top-item:hover::before {
    opacity: 1;
}

.gsc-top-rank {
    background: linear-gradient(135deg, #1A5DC9 0%, #3d7edb 100%);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26, 93, 201, 0.3);
    transition: all 0.3s ease;
}

.gsc-top-item:hover .gsc-top-rank {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(26, 93, 201, 0.4);
}

.gsc-top-content {
    flex: 1;
}

.gsc-top-title {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
    word-break: break-word;
    line-height: 1.5;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
}

.gsc-top-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #5f6368;
    flex-wrap: wrap;
    align-items: center;
}

.gsc-top-stats span:not(:last-child) {
    padding: 0.3rem 0.8rem;
    background: rgba(26, 93, 201, 0.08);
    border-radius: 6px;
    font-weight: 600;
    color: #1A5DC9;
}

/* Géographie et Appareils */
.gsc-geography-list,
.gsc-devices-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.gsc-geography-item,
.gsc-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    margin-bottom: 0.8rem;
}

.gsc-geography-item:hover,
.gsc-device-item:hover {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(26, 93, 201, 0.12);
    border-color: rgba(26, 93, 201, 0.2);
    transform: translateY(-2px);
}

.gsc-geography-item:hover,
.gsc-device-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

.gsc-country,
.gsc-device-name {
    font-weight: 600;
    color: var(--text-color-dark);
}

.gsc-geography-stats,
.gsc-device-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
    color: #5f6368;
    font-weight: 600;
}

.gsc-geography-stats span,
.gsc-device-stats span {
    padding: 0.4rem 0.9rem;
    background: rgba(26, 93, 201, 0.08);
    border-radius: 8px;
    color: #1A5DC9;
    font-weight: 700;
}

/* Projection de Trafic */
.gsc-projection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.gsc-projection-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gsc-projection-card.highlight {
    background: linear-gradient(135deg, #1A5DC9 0%, #3d7edb 50%, #5a9ef0 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(26, 93, 201, 0.25);
}

.gsc-projection-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
}

.gsc-projection-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    letter-spacing: -1px;
}

.gsc-projection-card.highlight .gsc-projection-value {
    color: #ffffff;
}

.gsc-projection-label {
    font-size: 0.95rem;
    color: #5f6368;
    font-weight: 600;
}

.gsc-projection-card.highlight .gsc-projection-label {
    color: rgba(255, 255, 255, 0.9);
}

.gsc-projection-details {
    margin-top: 2rem;
}

.gsc-projection-details h3 {
    font-size: 1.4rem;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.gsc-projection-list {
    display: grid;
    gap: 1rem;
}

.gsc-projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.gsc-projection-item:hover {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(26, 93, 201, 0.12);
    transform: translateX(4px);
}

.gsc-projection-month {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gsc-projection-month-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.gsc-projection-growth {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.gsc-projection-growth.positive {
    background: rgba(52, 168, 83, 0.1);
    color: #34A853;
}

.gsc-projection-growth.negative {
    background: rgba(234, 67, 53, 0.1);
    color: #EA4335;
}

.gsc-projection-clicks {
    font-size: 1.2rem;
    color: #1A5DC9;
    font-weight: 800;
}

.gsc-projection-note {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(26, 93, 201, 0.05);
    border-radius: 12px;
    border-left: 4px solid #1A5DC9;
}

.gsc-projection-note p {
    margin: 0;
    color: #5f6368;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    /* Modal responsive */
    .gsc-modal {
        padding: 10px !important;
    }
    
    .gsc-modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto !important;
        padding: 15px !important;
        max-height: 90vh !important;
    }
    
    .gsc-modal-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .gsc-modal-header h2 {
        font-size: 1.2rem !important;
    }
    
    .gsc-close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    /* Grilles en 1 colonne */
    .gsc-metrics-grid,
    .gsc-charts-grid,
    .gsc-two-columns,
    .gsc-opportunity-stats,
    .gsc-trends-list,
    .gsc-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Cards plus compactes */
    .gsc-metric-card {
        padding: 12px !important;
    }
    
    .gsc-metric-value {
        font-size: 1.5rem !important;
    }
    
    .gsc-metric-label {
        font-size: 0.75rem !important;
    }
    
    /* Sections */
    .gsc-section {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .gsc-section h3 {
        font-size: 1rem !important;
    }
    
    /* Charts */
    .gsc-chart-card {
        padding: 10px !important;
    }
    
    .gsc-chart-card canvas {
        max-height: 200px !important;
    }
    
    /* Liste d'opportunités */
    .gsc-opportunity-item {
        padding: 10px !important;
    }
    
    .gsc-opportunity-item .query {
        font-size: 0.85rem !important;
        word-break: break-word;
    }
    
    /* Top pages/queries lists */
    .gsc-top-item {
        padding: 10px !important;
    }
    
    .gsc-top-item .url,
    .gsc-top-item .query {
        font-size: 0.8rem !important;
        word-break: break-all;
    }
    
    /* Period selector */
    .gsc-period-selector {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .gsc-period-selector button {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }
    
    /* Traffic projection */
    .traffic-projection-card {
        padding: 15px !important;
    }
    
    .traffic-projection-card .value {
        font-size: 1.8rem !important;
    }
}

/* Très petits écrans */
@media (max-width: 380px) {
    .gsc-modal-content {
        padding: 10px !important;
    }
    
    .gsc-metric-value {
        font-size: 1.2rem !important;
    }
    
    .gsc-period-selector button {
        padding: 5px 8px !important;
        font-size: 0.7rem !important;
    }
}

