/* ============================================================
   css/enviar_foto.css
   Estilos exclusivos para enviar_foto.php
   ============================================================ */

/* ============================================================
   1. VARIABLES Y RESET
   ============================================================ */
:root {
    --primary-blue: #004d8c;
    --dark-blue: #002e5b;
    --accent-blue: #0072ce;
    --card-bg: #eef3f8;
    --text-dark: #222222;
    --text-gray: #666666;
    --bg-body: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #10b981;
    --danger: #ef4444;
}

body.dark-mode {
    --bg-body: #0f172a;
    --card-bg: #1e293b;
    --text-dark: #f1f5f9;
    --text-gray: #94a3b8;
    --border-color: #334155;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--accent-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================================
   2. INDICADOR DE CARGA
   ============================================================ */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

body.dark-mode .global-loader {
    background: rgba(15, 23, 42, 0.95);
}

.global-loader.active {
    display: flex;
}

.global-loader .spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--card-bg);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.global-loader p {
    margin-top: 16px;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================================
   3. BOTÓN TEMA OSCURO CON OCULTACIÓN AUTOMÁTICA
   ============================================================ */
.theme-toggle-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    opacity: 1;
    transform: translateY(0);
}

.theme-toggle-float:hover {
    transform: scale(1.08);
}

.theme-toggle-float.oculto-por-inactividad {
    opacity: 0.15;
    transform: translateY(20px) scale(0.85);
    pointer-events: none;
}

.theme-toggle-float.oculto-por-inactividad:hover {
    opacity: 1;
    transform: translateY(0) scale(1.08);
    pointer-events: auto;
}

/* ============================================================
   4. HEADER
   ============================================================ */
.top-header {
    background: var(--bg-body);
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 60px;
}

.brand-text .sub-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 0.5px;
    display: block;
}

.brand-text .main-title {
    font-size: 1.25rem;
    color: var(--primary-blue);
    line-height: 1.1;
}

body.dark-mode .brand-text .main-title {
    color: #60a5fa;
}

.brand-text .location {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.btn-volver-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-blue);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-volver-home:hover {
    background: var(--dark-blue);
    transform: translateX(-3px);
}

/* ============================================================
   5. NAVEGACIÓN
   ============================================================ */
.main-nav {
    background: var(--primary-blue);
}

body.dark-mode .main-nav {
    background: #1a2332;
}

.nav-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-list li a {
    display: block;
    padding: 12px 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-list li.active a,
.nav-list li a:hover {
    background: var(--dark-blue);
}

body.dark-mode .nav-list li.active a,
body.dark-mode .nav-list li a:hover {
    background: #2d3748;
}

/* ============================================================
   6. ENCABEZADO DE PARTICIPACIÓN
   ============================================================ */
.participar-header {
    background: var(--card-bg);
    padding: 30px 0;
    margin-bottom: 25px;
    border-bottom: 4px solid var(--primary-blue);
}

.participar-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.participar-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 77, 140, 0.3);
}

.participar-info h1 {
    font-size: 1.7rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.participar-info p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* ============================================================
   7. LAYOUT
   ============================================================ */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 25px;
    padding: 0 0 40px 0;
}

/* ============================================================
   8. ALERTAS
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

body.dark-mode .alert-success {
    background: #1a3a2a;
    color: #6ee7b7;
}

body.dark-mode .alert-danger {
    background: #3a1a1a;
    color: #fca5a5;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: inherit;
    opacity: 0.6;
    margin-left: 12px;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================================
   9. FORMULARIO
   ============================================================ */
.card-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.card-form h2 {
    font-size: 1.3rem;
    color: var(--primary-blue);
    margin-bottom: 6px;
}

body.dark-mode .card-form h2 {
    color: #60a5fa;
}

.card-form > p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.contacto-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

.contacto-form .form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contacto-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.contacto-form input,
.contacto-form select,
.contacto-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.contacto-form input:focus,
.contacto-form select:focus,
.contacto-form textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 77, 140, 0.1);
}

body.dark-mode .contacto-form input,
body.dark-mode .contacto-form select,
body.dark-mode .contacto-form textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .contacto-form input:focus,
body.dark-mode .contacto-form select:focus,
body.dark-mode .contacto-form textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

.contacto-form textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.contacto-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.help-text {
    font-size: 0.78rem;
    color: var(--text-gray);
    margin-top: 2px;
    line-height: 1.4;
}

/* ============================================================
   10. SUBIDA DE IMAGEN
   ============================================================ */
.file-upload-wrapper {
    position: relative;
    margin-top: 4px;
}

.file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
    color: var(--text-gray);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-label:hover,
.file-label.dragover {
    border-color: var(--primary-blue);
    background: rgba(0, 77, 140, 0.05);
    color: var(--primary-blue);
}

body.dark-mode .file-label {
    background: #0f172a;
}

body.dark-mode .file-label:hover,
body.dark-mode .file-label.dragover {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
}

.file-label i {
    font-size: 2rem;
}

.file-label span {
    font-size: 0.9rem;
    font-weight: 600;
}

.file-label small {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Previsualización de imagen */
.preview-imagen {
    margin-top: 12px;
}

.preview-item {
    position: relative;
    display: inline-block;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.preview-item img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-eliminar-imagen {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-eliminar-imagen:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ============================================================
   11. BOTÓN DE ENVÍO
   ============================================================ */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: #ffffff;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(0, 77, 140, 0.3);
    margin-top: 10px;
    text-decoration: none;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 77, 140, 0.5);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ============================================================
   12. TARJETA DE ÉXITO
   ============================================================ */
.success-card {
    text-align: center;
    padding: 50px 30px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.success-card h2 {
    font-size: 1.6rem;
    color: var(--success);
    margin-bottom: 12px;
}

.success-card p {
    color: var(--text-gray);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

/* ============================================================
   13. SIDEBAR
   ============================================================ */
.widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

body.dark-mode .widget-title {
    color: #60a5fa;
}

.widget-title h4 {
    font-size: 1rem;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-list li {
    font-size: 0.88rem;
    color: var(--text-dark);
    padding: 8px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    border-left: 3px solid var(--primary-blue);
    transition: var(--transition);
}

.info-list li:hover {
    transform: translateX(4px);
    border-left-color: var(--accent-blue);
}

body.dark-mode .info-list li {
    background: #0f172a;
}

.widget-quote {
    background: linear-gradient(135deg, #e8ede6, #d4e0d1);
    border-left: 4px solid #2e4d25;
    position: relative;
    overflow: hidden;
}

.widget-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    right: 10px;
    font-size: 6rem;
    font-family: 'Montserrat', serif;
    color: rgba(46, 77, 37, 0.1);
    line-height: 1;
}

body.dark-mode .widget-quote {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-left: 4px solid #60a5fa;
}

.quote-content p {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #2e4d25;
    line-height: 1.6;
    font-weight: 500;
}

body.dark-mode .quote-content p {
    color: #cbd5e1;
}

/* ============================================================
   14. FOOTER
   ============================================================ */
.site-footer {
    background: var(--dark-blue);
    color: #ffffff;
    padding: 20px 0;
    margin-top: 20px;
}

body.dark-mode .site-footer {
    background: #0f172a;
}

.footer-bottom-simple {
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.8;
}

/* ============================================================
   15. RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .brand-logo {
        justify-content: center;
    }

    .participar-header-content {
        flex-direction: column;
        text-align: center;
    }

    .participar-info h1 {
        font-size: 1.3rem;
    }

    .contacto-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .card-form {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .card-form {
        padding: 16px;
    }

    .btn-submit {
        width: 100%;
        padding: 12px 20px;
    }

    .success-icon {
        font-size: 3rem;
    }

    .success-card h2 {
        font-size: 1.3rem;
    }

    .file-label {
        padding: 20px 12px;
    }

    .file-label i {
        font-size: 1.5rem;
    }

    .file-label span {
        font-size: 0.82rem;
    }
}