/* ===== TEMA DEVDOCS - PORTAL MODERNO ===== */

/* Variables CSS */
:root {
    --primary-gradient: linear-gradient(135deg, #4a9eff, #a855f7);
    --secondary-gradient: linear-gradient(135deg, #a855f7, #00ff88);
    --success-gradient: linear-gradient(135deg, #00ff88, #4a9eff);
    --danger-gradient: linear-gradient(135deg, #ff4757, #ff6b81);
    --warning-gradient: linear-gradient(135deg, #ffc107, #ff9800);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #050505;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Soporte para body.dark (paginas de guias) */
body.dark {
    background: #050505;
    color: #e0e0e0;
}

body.light {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Fondo con gradientes animados */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(74, 158, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.08) 0%, transparent 60%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(2deg); }
}

/* Particulas flotantes */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(74, 158, 255, 0.6);
    border-radius: 50%;
    animation: float linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(168, 85, 247, 0.5);
}

.particle:nth-child(3n) {
    background: rgba(0, 255, 136, 0.5);
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* Contenedor principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4a9eff 0%, #a855f7 50%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.5)); }
    to { filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.7)); }
}

.header p {
    color: #888;
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Buscador */
.search-container {
    max-width: 500px;
    margin: 0 auto 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #666;
}

.search-input:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1rem;
}

.search-shortcut {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #666;
}

/* Estadisticas */
.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4a9eff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #666;
    font-size: 0.75rem;
    margin-top: 3px;
}

/* Secciones de categorias */
.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, #4a9eff, #a855f7);
    border-radius: 2px;
}

/* Grid de tarjetas */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Tarjetas de documentacion */
.doc-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.doc-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(168, 85, 247, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.doc-link:hover {
    transform: translateY(-4px);
    border-color: rgba(74, 158, 255, 0.3);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(74, 158, 255, 0.15);
}

.doc-link:hover::before {
    opacity: 1;
}

.doc-link-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.doc-link:hover .doc-link-icon {
    transform: scale(1.1) rotate(5deg);
}

.doc-link-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.doc-link-content span {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 6px;
}

.doc-link-desc {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}

.doc-link-arrow {
    font-size: 1.2rem;
    color: #666;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.doc-link:hover .doc-link-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #4a9eff;
}

/* Metadatos de artículos */
.article-meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #444;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }

    .stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .doc-link {
        padding: 16px 20px;
    }

    .doc-link-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Animacion de entrada */
.doc-link {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay escalonado para las tarjetas */
.doc-link:nth-child(1) { animation-delay: 0.1s; }
.doc-link:nth-child(2) { animation-delay: 0.15s; }
.doc-link:nth-child(3) { animation-delay: 0.2s; }
.doc-link:nth-child(4) { animation-delay: 0.25s; }
.doc-link:nth-child(5) { animation-delay: 0.3s; }
.doc-link:nth-child(6) { animation-delay: 0.35s; }
.doc-link:nth-child(7) { animation-delay: 0.4s; }
.doc-link:nth-child(8) { animation-delay: 0.45s; }
.doc-link:nth-child(9) { animation-delay: 0.5s; }
.doc-link:nth-child(10) { animation-delay: 0.55s; }
.doc-link:nth-child(11) { animation-delay: 0.6s; }
.doc-link:nth-child(12) { animation-delay: 0.65s; }
.doc-link:nth-child(13) { animation-delay: 0.7s; }
.doc-link:nth-child(14) { animation-delay: 0.75s; }
.doc-link:nth-child(15) { animation-delay: 0.8s; }

/* ===== ESTILOS PARA PAGINAS DE GUIAS ===== */

/* Encabezados secundarios */
h2, h3, h4 {
    color: #4a9eff;
    margin-bottom: 15px;
    font-weight: 600;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

/* Titulo h1 para paginas de guias */
body.dark h1,
body.light h1 {
    background: linear-gradient(135deg, #4a9eff 0%, #a855f7 50%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin: 30px 20px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

/* List group para guias (sobrescribe Bootstrap) */
.list-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px;
    list-style: none;
    margin: 0;
    background: transparent !important;
    border: none !important;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.list-group-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(168, 85, 247, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.list-group-item:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(74, 158, 255, 0.3) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(74, 158, 255, 0.15) !important;
}

.list-group-item:hover::before {
    opacity: 1;
}

.list-group-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff !important;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.list-group-item a:hover {
    color: #4a9eff !important;
}

.list-group-item .description {
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.list-group-item .icon {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.list-group-item:hover .icon {
    transform: scale(1.1) rotate(5deg);
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(74, 158, 255, 0.8));
}

/* Estilos para los comandos */
.command-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.command-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    color: #00ff88;
    position: relative;
    overflow-x: auto;
}

.command-code::before {
    content: '$ ';
    color: #4a9eff;
    font-weight: bold;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #4a9eff, #a855f7);
    border: none;
    border-radius: 5px;
    padding: 4px 10px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
}

/* Boton de regreso */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.3);
    transform: translateX(-5px);
    color: #4a9eff;
}

/* Secciones de contenido dinamico */
#contentSection {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
}

/* Estilos para ol y li */
ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

ol li {
    margin-bottom: 10px;
    color: #e0e0e0;
}

/* Secciones de guias */
.guide-section,
.rdp-section,
.gui-section,
.rsa-section,
.docker-section,
.install-docker-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    display: block;
}

.guide-section h2,
.rdp-section h2,
.gui-section h2,
.rsa-section h2,
.docker-section h2,
.install-docker-section h2 {
    color: #4a9eff;
    margin-bottom: 20px;
}

.guide-section ol,
.rdp-section ol,
.gui-section ol,
.rsa-section ol,
.docker-section ol,
.install-docker-section ol {
    padding-left: 20px;
}

.guide-section li,
.rdp-section li,
.gui-section li,
.rsa-section li,
.docker-section li,
.install-docker-section li {
    margin-bottom: 15px;
    color: #e0e0e0;
}

.guide-section code,
.rdp-section code,
.gui-section code,
.rsa-section code,
.docker-section code,
.install-docker-section code {
    background: rgba(0, 0, 0, 0.4);
    color: #00ff88;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

/* Caja de advertencia */
.warning-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-left: 4px solid #ffc107;
    padding: 18px 20px;
    border-radius: 12px;
    margin: 24px 0;
    font-size: 1rem;
}

.warning-box h4 {
    color: #ffc107;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box p {
    color: #e0e0e0;
    margin-bottom: 0;
}

/* Caja de nota/consejo */
.note {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(168, 85, 247, 0.1));
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-left: 4px solid #4a9eff;
    padding: 18px 20px;
    border-radius: 12px;
    margin: 24px 0;
    font-size: 1rem;
}

.note strong {
    color: #4a9eff;
    font-weight: bold;
    margin-right: 8px;
}

.note p {
    color: #e0e0e0;
    margin-bottom: 0;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a9eff, #a855f7);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a855f7, #00ff88);
}

/* ===== TEMA CLARO PARA PAGINAS DE GUIAS ===== */

body.light .list-group-item {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light .list-group-item:hover {
    background: rgba(74, 158, 255, 0.05) !important;
    border-color: rgba(74, 158, 255, 0.3) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 40px rgba(74, 158, 255, 0.1) !important;
}

body.light .list-group-item a {
    color: #1a1a1a !important;
}

body.light .list-group-item a:hover {
    color: #4a9eff !important;
}

body.light .list-group-item .description {
    color: #666;
}

body.light .list-group-item .icon {
    filter: brightness(0);
}

body.light .list-group-item:hover .icon {
    filter: brightness(0) drop-shadow(0 0 8px rgba(74, 158, 255, 0.8));
}

body.light .command-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light .command-code {
    background: rgba(0, 0, 0, 0.06);
    color: #0066cc;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light .command-code::before {
    color: #4a9eff;
}

body.light .search-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body.light .search-input::placeholder {
    color: #999;
}

body.light .search-input:focus {
    background: rgba(0, 0, 0, 0.05);
}

body.light .back-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body.light .back-btn:hover {
    background: rgba(74, 158, 255, 0.1);
}

body.light .back-btn .icon {
    filter: brightness(0);
}

body.light h2, body.light h3, body.light h4 {
    color: #4a9eff;
}

body.light .warning-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.15));
    color: #856404;
    border-color: rgba(255, 193, 7, 0.4);
}

body.light .warning-box h4 {
    color: #856404;
}

body.light .warning-box p {
    color: #664d03;
}

body.light .note {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(168, 85, 247, 0.1));
    color: #0c5460;
}

body.light .note strong {
    color: #4a9eff;
}

body.light .note p {
    color: #0c5460;
}

/* Animaciones para slideInUp y slideOutDown (usadas en guias) */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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