/* assets/dashboard.css */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&display=swap');

/* 16:9 Full Screen Dashboard Layout */
.csd-dashboard {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 30px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.csd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.csd-header h1 {
    margin: 0;
    color: white;
    font-size: 2.8em;
    font-weight: 300;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.csd-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Titillium Web', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    backdrop-filter: blur(10px);
}

.csd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    flex: 1;
    height: calc(100vh - 180px); /* Account for header space */
    min-height: 0;
}

.csd-widget {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.csd-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.csd-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.csd-widget-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
    font-family: 'Titillium Web', sans-serif;
}

.csd-loading {
    color: #95a5a6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-family: 'Titillium Web', sans-serif;
    display: none;
}

.csd-loading.show {
    display: inline-block;
}

.csd-widget-content {
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.csd-value {
    font-size: 3.5em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    font-family: 'Titillium Web', sans-serif;
    margin-bottom: 10px;
}

.csd-comparison {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    background: #f8f9fa;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Titillium Web', sans-serif;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csd-trend {
    font-size: 20px;
    font-weight: bold;
}

.csd-trend-up {
    color: #27ae60;
}

.csd-trend-down {
    color: #e74c3c;
}

.csd-trend-same {
    color: #95a5a6;
}

.csd-change {
    font-weight: 700;
    letter-spacing: 0.3px;
    font-family: 'Titillium Web', sans-serif;
}

.csd-trend-up + .csd-change {
    color: #27ae60;
}

.csd-trend-down + .csd-change {
    color: #e74c3c;
}

.csd-trend-same + .csd-change {
    color: #95a5a6;
}

/* TrustPilot Widget - Takes up 2x1 space */
.csd-widget-trustpilot {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.95);
}

.csd-widget-trustpilot .csd-widget-content {
    text-align: left;
    align-items: flex-start;
}

.csd-error {
    background: rgba(254, 238, 238, 0.95);
    color: #c33;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(252, 204, 204, 0.8);
    text-align: center;
    font-weight: 600;
    font-family: 'Titillium Web', sans-serif;
    backdrop-filter: blur(10px);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.csd-loading {
    animation: pulse 1.5s infinite;
}

/* Responsive adjustments for smaller 16:9 screens */
@media (max-width: 1600px) {
    .csd-dashboard {
        padding: 25px;
    }
    
    .csd-header h1 {
        font-size: 2.4em;
    }
    
    .csd-value {
        font-size: 3em;
    }
    
    .csd-widget {
        padding: 25px;
    }
}

@media (max-width: 1200px) {
    .csd-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    
    .csd-widget-trustpilot {
        grid-column: span 3;
    }
}

/* For very small screens, stack vertically but maintain proportions */
@media (max-width: 900px) {
    .csd-dashboard {
        padding: 20px;
        height: auto;
        min-height: 100vh;
    }
    
    .csd-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        height: auto;
    }
    
    .csd-widget-trustpilot {
        grid-column: span 2;
    }
    
    .csd-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .csd-header h1 {
        font-size: 2em;
    }
    
    .csd-value {
        font-size: 2.5em;
    }
}

/* Dark mode support with gradient background */
@media (prefers-color-scheme: dark) {
    .csd-dashboard {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .csd-widget {
        background: rgba(52, 73, 94, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .csd-widget-header h3 {
        color: #e2e8f0;
    }
    
    .csd-value {
        color: #e2e8f0;
    }
    
    .csd-comparison {
        background: rgba(0, 0, 0, 0.3);
        color: #e2e8f0;
    }
}

/* Print styles for 16:9 layout */
@media print {
    .csd-dashboard {
        background: white !important;
        height: auto;
        padding: 20px;
    }
    
    .csd-header {
        border-bottom: 2px solid #000;
    }
    
    .csd-header h1 {
        color: #000 !important;
    }
    
    .csd-widget {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        background: white !important;
    }
    
    .csd-btn {
        display: none;
    }
    
    .csd-grid {
        height: auto;
    }
}