/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-dark-gray: #2c3e50;
    --color-green: #27ae60;
    --color-blue: #3498db;
    --color-red: #e74c3c;
    --color-light-gray: #95a5a6;
    --color-bg: #ecf0f1;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container */
.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    max-width: 900px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 3px solid var(--color-dark-gray);
    padding-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-dark-gray);
    margin-bottom: 10px;
}

.last-update {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
    display: block;
    margin-bottom: 15px;
}

/* Header Controls */
.header-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Funnel Container */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Funnel Band */
.funnel-band {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 8px;
    transition: var(--transition);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.funnel-band:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.band-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.band-number {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.band-label {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.percentage {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Color Bands */
.band-1 {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    width: 100%;
}

.band-2 {
    background: linear-gradient(135deg, #00a651 0%, #008040 100%);
    color: white;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.band-3 {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

.band-4 {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    width: 55%;
    margin-left: auto;
    margin-right: auto;
}

.band-5 {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    color: white;
    width: 40%;
    margin-left: auto;
    margin-right: auto;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header-controls {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        padding: 12px 18px;
        font-size: 0.85rem;
    }

    .toggle-group {
        justify-content: center;
        width: 100%;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    .band-number {
        font-size: 1.5rem;
    }

    .band-label {
        font-size: 0.85rem;
    }

    .funnel-band {
        padding: 15px;
        min-height: 70px;
    }

    .band-2 {
        width: 80%;
    }

    .band-3 {
        width: 60%;
    }

    .band-4 {
        width: 45%;
    }

    .band-5 {
        width: 35%;
    }

    /* Download Section Responsive */
    .download-section {
        padding: 20px;
    }

    .download-header h2 {
        font-size: 1.3rem;
    }

    .date-filters {
        flex-direction: column;
        gap: 15px;
    }

    .date-input-group {
        width: 100%;
    }

    .btn-download-large {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

/* Buttons */
.btn {
    padding: 11px 24px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: #3b5bdb;
    background: linear-gradient(180deg, #4c63d2 0%, #3b5bdb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #3f58cd 0%, #2f4bc9 100%);
}

.btn-success {
    background: #1abc9c;
    background: linear-gradient(180deg, #1abc9c 0%, #16a085 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(180deg, #16a085 0%, #138d75 100%);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon Only Button */
.btn-icon-only {
    background: none;
    border: none;
    color: #2c3e50;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.btn-icon-only:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #3b5bdb;
    transform: rotate(180deg);
}

.btn-icon-only:active {
    background: rgba(0, 0, 0, 0.08);
}

/* Download Button */
.btn-download {
    background: #1abc9c;
    background: linear-gradient(180deg, #1abc9c 0%, #16a085 100%);
    color: white;
    padding: 11px 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-download:hover {
    background: linear-gradient(180deg, #16a085 0%, #138d75 100%);
}

.btn-download i {
    font-size: 0.95rem;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #bdc3c7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
    background-color: #1abc9c;
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.3);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
}

/* Error Message */
.error-message {
    background-color: #fadbd8;
    border: 1px solid #f5b7b1;
    color: #c0392b;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.error-message.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Download Section */
.download-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.download-header {
    text-align: center;
    margin-bottom: 25px;
}

.download-header h2 {
    font-size: 1.5rem;
    color: var(--color-dark-gray);
    margin-bottom: 8px;
    font-weight: 700;
}

.download-header p {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.date-filters {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.date-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark-gray);
}

.date-input {
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--color-text);
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.date-input:focus {
    outline: none;
    border-color: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.1);
}

.date-input:hover {
    border-color: #adb5bd;
}

.btn-download-large {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
    padding: 16px 40px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-download-large:hover {
    background: linear-gradient(135deg, #16a085 0%, #138d75 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4);
}

.btn-download-large:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
}

.btn-download-large i {
    font-size: 1.1rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}
