/* ======================================================================
   RESET Y CONFIGURACIÓN BASE
   ====================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('../assets/luque-city.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

/* ======================================================================
   TIPOGRAFÍA
   ====================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
}

h1 {
    font-size: 2.2rem;
    color: #ffffff;
}

h2 {
    font-size: 1.8rem;
    color: #006400;
}

h3 {
    font-size: 1.5rem;
    color: #004d00;
}

h4 {
    font-size: 1.2rem;
    color: #333;
}

p {
    margin-bottom: 15px;
}

a {
    color: #006400;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #004d00;
    text-decoration: underline;
}

/* ======================================================================
   LAYOUT Y CONTENEDORES
   ====================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================================================================
   HEADER Y NAVEGACIÓN
   ====================================================================== */
.header {
    background: linear-gradient(135deg, #006400 0%, #004d00 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

.header h1 {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 span:first-child {
    flex: 1;
    min-width: 250px;
}

/* ======================================================================
   TARJETAS Y PANELES
   ====================================================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 100, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #006400, #00a000);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #006400;
}

.card h3 {
    color: #006400;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 i {
    font-size: 1.2em;
}

.stats-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #006400;
    text-align: center;
    margin: 25px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Arial Black', sans-serif;
}

/* ======================================================================
   FORMULARIOS
   ====================================================================== */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #006400;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #006400;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.form-control::placeholder {
    color: #999;
}

.form-control.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-control.invalid {
    border-color: #dc3545;
    background-color: #fff9f9;
}

/* ======================================================================
   BOTONES
   ====================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 100, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #004d00 0%, #006400 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 100, 0, 0.3);
    text-decoration: none;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: linear-gradient(135deg, #cccccc 0%, #aaaaaa 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover::before {
    display: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

/* ======================================================================
   PESTAÑAS DE NAVEGACIÓN
   ====================================================================== */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 100, 0, 0.2);
}

.nav-tab:hover {
    background: linear-gradient(135deg, #004d00 0%, #006400 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 100, 0, 0.3);
    text-decoration: none;
    color: white;
}

.nav-tab.active {
    background: linear-gradient(135deg, #004d00 0%, #003300 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
}

/* ======================================================================
   TABLAS
   ====================================================================== */
.table-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

.table-container h3 {
    color: #006400;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
}

.table th {
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: white;
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th:first-child {
    border-top-left-radius: 8px;
}

.table th:last-child {
    border-top-right-radius: 8px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    vertical-align: middle;
}

.table tr {
    transition: background-color 0.2s ease;
}

.table tr:hover {
    background-color: #f8fff8;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* ======================================================================
   BANNERS Y ALERTAS
   ====================================================================== */
.welcome-banner {
    background: linear-gradient(135deg, #006400, #00a000);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0, 100, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.welcome-banner h2, .welcome-banner h3 {
    color: white;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.alert {
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ======================================================================
   BOTONES DE EXPORTACIÓN
   ====================================================================== */
.export-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.export-buttons .btn {
    flex: 1;
    min-width: 180px;
}

/* ======================================================================
   ESTILOS PARA EL FORMULARIO DE ENCUESTA
   ====================================================================== */
.survey-section {
    margin: 30px 0;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border-left: 5px solid #006400;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.survey-question {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.survey-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-text {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    line-height: 1.5;
    font-size: 1.05rem;
    position: relative;
}

.question-text::after {
    content: '*';
    color: #dc3545;
    font-weight: bold;
    position: absolute;
    right: 5px;
    top: 0;
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    user-select: none;
}

.option-label:hover {
    border-color: #006400;
    background-color: #f0fff0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 100, 0, 0.1);
}

.option-label input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.option-label.selected {
    border-color: #006400;
    background-color: #e6ffe6;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 100, 0, 0.15);
}

.section-title {
    background: linear-gradient(135deg, #006400, #008000);
    color: white;
    padding: 18px 25px;
    border-radius: 10px;
    margin: 40px 0 25px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.section-title h3 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.section-title i {
    font-size: 1.4rem;
}

.required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* ======================================================================
   ESTILOS PARA GEOLOCALIZACIÓN
   ====================================================================== */
.location-status {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 10px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.location-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.location-icon {
    font-size: 1.2em;
}

.coordinates-display {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
    line-height: 1.6;
}

.coordinates-display strong {
    color: #006400;
}

/* ======================================================================
   ANIMACIONES ESPECIALES
   ====================================================================== */
.parpadeo {
    animation: parpadeo 2s infinite;
    font-weight: bold;
    color: #006400;
}

@keyframes parpadeo {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pregunta-error {
    border-left: 4px solid #dc3545 !important;
    padding-left: 21px !important;
    background-color: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.fa-spinner.fa-spin {
    animation: fa-spin 1.5s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======================================================================
   TOOLTIPS
   ====================================================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 1001;
}

/* ======================================================================
   RESPONSIVE DESIGN
   ====================================================================== */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
}

@media (max-width: 992px) {
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .form-container {
        padding: 30px;
        margin: 20px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        width: 100%;
        justify-content: center;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons .btn {
        width: 100%;
    }
    
    .options-container {
        flex-direction: column;
    }
    
    .option-label {
        width: 100%;
    }
    
    .section-title {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }
    
    .table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    .table {
        font-size: 0.9em;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .stats-number {
        font-size: 2.8rem;
    }
    
    .form-container {
        padding: 20px;
        margin: 10px;
    }
    
    .form-control {
        padding: 12px 15px;
    }
    
    .survey-section {
        padding: 15px;
    }
    
    .welcome-banner {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px 20px;
    }
    
    .card h3 {
        font-size: 1.2rem;
    }
    
    .section-title h3 {
        font-size: 1.1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option-label {
        padding: 10px 15px;
        min-width: 100%;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .header, .nav-tabs, .export-buttons, .btn {
        display: none !important;
    }
    
    .table-container {
        box-shadow: none !important;
        background: white !important;
    }
    
    .table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
}