/* QuickSurvey - Design Colorato e Moderno */
/* Author: Bangherang Studio */

:root {
    --primary: #6366f1;  /* Indigo vivace */
    --secondary: #8b5cf6; /* Purple */
    --accent: #ec4899;   /* Pink */
    --success: #10b981;  /* Green */
    --warning: #f59e0b;  /* Amber */
    --info: #3b82f6;     /* Blue */
    --danger: #ef4444;   /* Red */
    --dark: #1f2937;
    --light: #f9fafb;
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.16), 0 4px 6px rgba(0,0,0,0.23);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --radius: 12px;
    --chart-colors: #6366f1, #8b5cf6, #ec4899, #f59e0b, #10b981, #3b82f6, #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Colorato */
.header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: none;
    box-shadow: var(--shadow-md);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--dark);
    opacity: 0.7;
    font-weight: 400;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.survey-selector {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--light);
    font-size: 14px;
    min-width: 220px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.survey-selector:hover,
.survey-selector:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.btn-export {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
}

/* Survey Info Card */
.survey-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.survey-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.survey-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    background: var(--light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--dark);
    font-weight: 500;
}

.meta-separator {
    display: none;
}

.survey-question {
    font-size: 16px;
    color: var(--dark);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-top: 15px;
    border-left: 4px solid var(--primary);
}

.question-type {
    color: var(--primary);
    font-weight: 600;
    margin-left: 8px;
}

/* Tabs Colorati */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.tab:hover {
    background: rgba(99, 102, 241, 0.1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Cards Colorate */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

/* Metriche Colorate */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.metric:hover {
    transform: scale(1.05);
}

.metric:nth-child(2) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.metric:nth-child(3) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.metric:nth-child(4) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 12px;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.8;
}

/* Tabelle Moderne */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.data-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
}

/* Progress bars Colorate */
.progress-bar {
    display: inline-block;
    width: 120px;
    height: 8px;
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Filtri Moderni */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--light);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

/* Cross-selling Cards */
.cross-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.cross-item {
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.3s ease;
}

.cross-item:hover {
    transform: scale(1.05);
}

.cross-product {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.cross-rate {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cross-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark);
    opacity: 0.7;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--dark);
    opacity: 0.7;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Footer */
.footer {
    background: var(--card-bg);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--dark);
    opacity: 0.8;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    padding: 10px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

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

    .tabs {
        overflow-x: auto;
        gap: 4px;
    }

    .tab {
        padding: 10px 16px;
        white-space: nowrap;
    }
}