/* =========================================== */
/* VARIABLES GLOBALES */
/* =========================================== */
:root {
    --color-bg: #121212;
    --color-text: #e0e0e0;
    --color-accent: #F28A2C;
    --color-secondary: #E5E5E5;
    --color-tertiary: #1D3E72;
    --color-danger: #cf6679;
    --color-surface: #1e1e1e;
    --color-surface-light: #2c2c2c;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;
    
    --font-primary: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.2);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.25);
    
    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* =========================================== */
/* RESET Y ESTILOS BASE */
/* =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        repeating-linear-gradient(75deg, 
            hsla(83,0%,53%,0.03) 0px, 
            hsla(83,0%,53%,0.03) 1px,
            transparent 1px, 
            transparent 12px),
        repeating-linear-gradient(67.5deg, 
            hsla(83,0%,53%,0.03) 0px, 
            hsla(83,0%,53%,0.03) 1px,
            transparent 1px, 
            transparent 12px),
        repeating-linear-gradient(157.5deg, 
            hsla(83,0%,53%,0.03) 0px, 
            hsla(83,0%,53%,0.03) 1px,
            transparent 1px, 
            transparent 12px),
        linear-gradient(165deg, 
            rgb(29,62,114), 
            rgb(242,138,44));
    background-size: cover;
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================== */
/* HEADER */
/* =========================================== */
.header-main {
    padding: 30px 0;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: transform var(--transition-normal);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-accent);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.logo-img:hover {
    border-color: var(--color-tertiary);
    box-shadow: 0 0 20px rgba(242, 138, 44, 0.5);
}

.header-text {
    text-align: center;
}

@media (min-width: 768px) {
    .header-text {
        text-align: left;
        margin-left: 30px;
    }
}

.site-title {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 5px;
    background: linear-gradient(45deg, var(--color-accent), var(--color-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.site-subtitle {
    font-size: 1.2rem;
    color: var(--color-secondary);
    margin-bottom: 15px;
    opacity: 0.9;
}

.social-icons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

@media (min-width: 768px) {
    .social-icons {
        justify-content: flex-start;
    }
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.social-link:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.social-link:nth-child(1):hover { background: #1877F2; } /* Facebook */
.social-link:nth-child(2):hover { background: #E4405F; } /* Instagram */
.social-link:nth-child(3):hover { background: #1DA1F2; } /* Twitter */
.social-link:nth-child(4):hover { background: #25D366; } /* WhatsApp */

/* =========================================== */
/* CONTENIDO PRINCIPAL */
/* =========================================== */
.main-content {
    flex: 1;
    padding: 40px 0;
}

.tree-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--color-text);
    position: relative;
    padding-bottom: 10px;
}

.tree-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-tertiary));
    border-radius: 3px;
}

.tree-list {
    list-style: none;
    display: grid;
    gap: 20px;
}

@media (min-width: 768px) {
    .tree-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* =========================================== */
/* TARJETAS DE CATEGORÍAS */
/* =========================================== */
.tree-item {
    position: relative;
}

.category-card {
    background: linear-gradient(135deg, var(--color-surface), var(--color-surface-light));
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-tertiary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 1.8rem;
    color: var(--color-accent);
    min-width: 40px;
    text-align: center;
}

.category-title {
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
    margin: 0;
}

.toggle-icon {
    color: var(--color-accent);
    font-size: 1.2rem;
    transition: transform var(--transition-normal);
}

.category-card.active .toggle-icon {
    transform: rotate(180deg);
}

/* =========================================== */
/* SUBCATEGORÍAS */
/* =========================================== */
.subcategories {
    display: none;
    padding: 20px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: -10px;
    border: 2px solid var(--color-surface-light);
    border-top: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subcategory-group {
    margin-bottom: 25px;
}

.subcategory-group:last-child {
    margin-bottom: 0;
}

.subcategory-title {
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(242, 138, 44, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.documents-list {
    list-style: none;
    padding-left: 10px;
}

.documents-list li {
    margin-bottom: 10px;
    padding-left: 5px;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(40, 40, 40, 0.7);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    transition: all var(--transition-normal);
    border-left: 3px solid transparent;
}

.doc-link:hover {
    background: rgba(242, 138, 44, 0.2);
    border-left-color: var(--color-accent);
    transform: translateX(5px);
    color: white;
}

.doc-link i {
    color: var(--color-accent);
    font-size: 1.1rem;
    min-width: 20px;
}

.doc-link.external:hover i {
    color: var(--color-tertiary);
}

.doc-coming {
    display: inline-block;
    padding: 12px 15px;
    background: rgba(60, 60, 60, 0.5);
    border-radius: var(--radius-md);
    color: var(--color-secondary);
    font-style: italic;
    opacity: 0.7;
    border-left: 3px solid var(--color-warning);
}

/* =========================================== */
/* MODAL */
/* =========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: linear-gradient(135deg, var(--color-surface), var(--color-surface-light));
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--color-accent);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    background: linear-gradient(90deg, var(--color-tertiary), var(--color-accent));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.access-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(29, 62, 114, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(29, 62, 114, 0.3);
}

.access-info i {
    font-size: 3rem;
    color: var(--color-tertiary);
    margin-bottom: 15px;
}

.access-info p {
    color: var(--color-text);
    font-size: 1.1rem;
    margin: 0;
}

/* =========================================== */
/* FORMULARIO DE LOGIN */
/* =========================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-label i {
    color: var(--color-accent);
}

.form-input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(242, 138, 44, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-submit {
    background: linear-gradient(90deg, var(--color-accent), var(--color-tertiary));
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 138, 44, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.form-help {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-help p {
    color: var(--color-secondary);
    font-size: 0.9rem;
}

.help-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.help-link:hover {
    text-decoration: underline;
}

/* =========================================== */
/* FOOTER */
/* =========================================== */
.site-footer {
    padding: 25px 0;
    background: rgba(30, 30, 30, 0.95);
    border-top: 2px solid var(--color-tertiary);
    margin-top: 50px;
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--color-secondary);
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-text i {
    color: var(--color-accent);
}

.developer-credit {
    color: var(--color-text);
    font-size: 0.9rem;
}

.developer-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-normal);
}

.developer-link:hover {
    color: var(--color-tertiary);
    text-decoration: underline;
}

/* =========================================== */
/* RESPONSIVE */
/* =========================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }
    
    .tree-title {
        font-size: 1.7rem;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .modal-container {
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .tree-list {
        grid-template-columns: 1fr;
    }
    
    .site-title {
        font-size: 1.8rem;
    }
}

/* =========================================== */
/* UTILIDADES */
/* =========================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* =========================================== */
/* ANIMACIONES */
/* =========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }
.animate-delay-5 { animation-delay: 0.5s; opacity: 0; }

/* =========================================== */
/* ESTILOS PARA TABLET EN PC (SIMULACIÓN) */
/* =========================================== */
@media (min-width: 1024px) {
    body {
        max-width: 768px;
        margin: 0 auto;
        padding: 20px;
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
        border-radius: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        min-height: calc(100vh - 40px);
        position: relative;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, #1a1a2e, #16213e);
        z-index: -1;
    }
}