/* SurveyColombia Corporate Identity - Main Dashboard */
:root {
    --primary-dark: #00507c;
    --primary-medium: #006994;
    --primary-light: #0088b0;
    --gray-dark: #939393;
    --gray-medium: #b0b0b0;
    --gray-light: #e8e8e8;
    --black: #000000;
    --white: #ffffff;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    color: var(--black);
    overflow-x: hidden;
}

/* Typography - Corporate Identity */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Sidebar - SurveyColombia Style */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-xl);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 45px;
    height: auto;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(5px);
}

.nav-item.active {
    background: var(--white);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.nav-item.active i {
    color: var(--primary-dark);
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--white);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
}

.user-info i {
    font-size: 1.5rem;
}

.user-email {
    font-size: 0.75rem;
    opacity: 0.8;
    font-family: 'Roboto', sans-serif;
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
}

.top-bar {
    background: var(--white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    color: var(--gray-dark);
}

.btn-icon:hover {
    background: var(--gray-light);
    color: var(--primary-dark);
    transform: rotate(180deg);
}

.date-time {
    font-size: 0.875rem;
    color: var(--gray-dark);
    font-family: 'Roboto', sans-serif;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border-left: 4px solid var(--primary-dark);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-header i {
    font-size: 2rem;
    color: var(--primary-dark);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.stat-label {
    color: var(--gray-dark);
    font-size: 0.875rem;
    font-family: 'Roboto', sans-serif;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    color: var(--white);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.875rem;
    font-family: 'Roboto', sans-serif;
}

.data-table tbody tr:hover {
    background: rgba(0, 80, 124, 0.05);
    transition: var(--transition);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid #28a745;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.badge-info {
    background: rgba(0, 80, 124, 0.1);
    color: var(--primary-dark);
    border: 1px solid var(--primary-dark);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.btn-primary {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* Filters */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 250px;
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-dark);
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--white);
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: var(--white);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-light);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.page-btn.active {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
}

.page-btn:hover:not(.active) {
    background: var(--gray-light);
    border-color: var(--primary-dark);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
    font-family: 'Roboto', sans-serif;
}

.notification-success {
    border-left-color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-info {
    border-left-color: var(--primary-dark);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 1rem;
    }
}

/* Logo handling */
.sidebar-header .logo {
    width: 40px;
    height: auto;
}

.logo-fallback {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-fallback span {
    color: #00507c;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 20px;
}