/* ========== CSS VARIABLES - TEMA OSCURO/CLARO ========== */
:root {
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-dark: #f8fafc;
    --text-light: #0f172a;
    --border-dark: #1e293b;
    --border-light: #e2e8f0;
    --accent-emerald: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-yellow: #fbbf24;
    --accent-orange: #f97316;
}

body.light-mode {
    --bg-dark: #f5f1eb;
    --bg-light: #0f172a;
    --text-dark: #3d2817;
    --text-light: #f8fafc;
    --border-dark: #d4c4b0;
    --border-light: #1e293b;
}

/* ========== RESET & FUNDAMENTOS ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    caret-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* ========== HEADER ========== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    padding: 0 32px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-dark);
    z-index: 50;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

header .container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo-section {
    padding-bottom: 10px;
}

header .logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}

body.light-mode header .logo-section h1 {
    color: #3d2817;
}

header .logo-section p {
    font-size: 1rem;
    font-weight: 500;
    color: #10b981;
}

header .social-links {
    display: flex;
    gap: 12px;
}

header a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid #475569;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

header a:hover {
    background-color: #1e293b;
}

header svg {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

header a:hover svg {
    color: #cbd5e1;
}

/* ========== MAIN CONTENT ========== */
main {
    margin-top: 110px;
    margin-bottom: 60px;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 32px;
    padding-top: 48px;
}

/* ========== HERO SECTION ========== */
.hero-section {
    margin-bottom: 64px;
    text-align: center;
}

.hero-section h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-section p {
    color: #9ca3af;
    font-size: 1rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.75;
}

/* ========== SECTIONS GENERALES ========== */
section {
    margin-bottom: 64px;
    scroll-margin-top: 130px;
}

section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

section h2 .accent-bar {
    width: 24px;
    height: 4px;
    background-color: #10b981;
    border-radius: 9999px;
}

/* ========== ABOUT SECTION ========== */
#about {
    margin-bottom: 64px;
}

#about .content-box {
    background-color: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 32px;
}

#about p {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.75;
}

#about p + p {
    margin-top: 16px;
}

body.light-mode #about .content-box {
    background-color: #f5f1eb;
    border-color: #d4c4b0;
}

body.light-mode #about p {
    color: #5d4837;
}

/* ========== SKILLS SECTION ========== */
#skills .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    #skills .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.skill-box {
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.skill-box h3 {
    font-size: 0.875rem;
    text-align: center;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 16px;
}

.skill-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.skill-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-icon:hover {
    transform: translateY(-3px);
}

.skill-icon i {
    font-size: 1.75rem;
}

.skill-icon span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* Variantes de color para skill icons */
.skill-icon.blue {
    background-color: rgba(59, 130, 246, 0.2);
}

.skill-icon.blue:hover {
    background-color: rgba(59, 130, 246, 0.4);
}

.skill-icon.blue i,
.skill-icon.blue span {
    color: #3b82f6;
}

.skill-icon.orange {
    background-color: rgba(249, 115, 22, 0.2);
}

.skill-icon.orange:hover {
    background-color: rgba(249, 115, 22, 0.4);
}

.skill-icon.orange i,
.skill-icon.orange span {
    color: #f97316;
}

.skill-icon.purple {
    background-color: rgba(168, 85, 247, 0.2);
}

.skill-icon.purple:hover {
    background-color: rgba(168, 85, 247, 0.4);
}

.skill-icon.purple i,
.skill-icon.purple span {
    color: #a855f7;
}

.skill-icon.red {
    background-color: rgba(239, 68, 68, 0.2);
}

.skill-icon.red:hover {
    background-color: rgba(239, 68, 68, 0.4);
}

.skill-icon.red i,
.skill-icon.red span {
    color: #ef4444;
}

.skill-icon.emerald {
    background-color: rgba(16, 185, 129, 0.2);
}

.skill-icon.emerald:hover {
    background-color: rgba(16, 185, 129, 0.4);
}

.skill-icon.emerald i,
.skill-icon.emerald span {
    color: #059669;
}

body.light-mode .skill-box {
    background-color: #f5f1eb;
    border-color: #d4c4b0;
}

body.light-mode .skill-icon.blue {
    background-color: rgba(59, 130, 246, 0.15);
}

body.light-mode .skill-icon.orange {
    background-color: rgba(249, 115, 22, 0.15);
}

/* ========== PROJECTS SECTION ========== */
#projects .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    #projects .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.project-card {
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-3px);
}

.project-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.project-tag.blue {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.project-tag.orange {
    background-color: rgba(249, 115, 22, 0.2);
    color: #9a3412;
}

.project-tag.green {
    background-color: rgba(34, 197, 94, 0.2);
    color: #15803d;
}

.project-tag.red {
    background-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.project-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.project-card p {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 16px;
    text-align: justify;
}

.project-card .flex-grow {
    flex-grow: 1;
}

.project-card .button-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
}

.project-card button,
.project-card a {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-card button {
    background-color: #10b981;
    color: white;
}

.project-card button:hover {
    background-color: #059669;
}

.project-card a {
    border: 1px solid #475569;
    color: #e2e8f0;
    text-decoration: none;
    display: inline-block;
}

.project-card a:hover {
    background-color: #1e293b;
}

body.light-mode .project-card {
    background-color: #f5f1eb;
    border-color: #d4c4b0;
}

body.light-mode .project-card p {
    color: #5d4837;
}

/* ========== SIDEBAR FLOTANTE ========== */
aside {
    position: fixed;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
}

aside nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
}

aside a,
aside button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

aside a:hover,
aside button:hover {
    background-color: #334155;
}

aside svg,
aside i {
    width: 20px;
    height: 20px;
}

aside a.emerald svg {
    color: #10b981;
}

aside a.emerald:hover svg {
    color: #6ee7b7;
}

aside a.blue svg {
    color: #3b82f6;
}

aside a.blue:hover svg {
    color: #93c5fd;
}

aside a.purple svg {
    color: #a855f7;
}

aside a.purple:hover svg {
    color: #d8b4fe;
}

aside button.yellow {
    color: #fbbf24;
}

aside button.yellow:hover {
    color: #fcd34d;
}

aside .divider {
    border-top: 1px solid #475569;
    margin: 8px 0;
}

/* ========== FOOTER ========== */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    padding: 0 32px;
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border-dark);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.visitor-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
    transition: all 0.3s ease;
}

.visitor-counter:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.visitor-counter img {
    height: 18px;
    vertical-align: middle;
}

body.light-mode .visitor-counter {
    background: rgba(15, 23, 42, 0.15);
    border-color: rgba(15, 23, 42, 0.2);
    color: #3d2817;
}

body.light-mode .visitor-counter:hover {
    background: rgba(15, 23, 42, 0.25);
}

footer .copyright {
    flex: 1;
    text-align: center;
}

footer p {
    color: #9ca3af;
    font-size: 0.75rem;
    margin: 0;
}

body.light-mode footer p {
    color: #5d4837;
}

/* ========== MODAL DE VIDEOS ========== */
.video-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    cursor: default;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    color: #e2e8f0;
}

.video-modal-video {
    width: 100%;
    border-radius: 8px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    aside {
        left: 16px;
    }
    
    main {
        padding: 0 16px;
    }
    
    header {
        padding: 0 16px;
    }
    
    footer {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    aside {
        display: none;
    }
    
    main {
        margin-left: 0;
        margin-right: 0;
    }
    
    header .logo-section h1 {
        font-size: 1rem;
    }
    
    .hero-section h2 {
        font-size: 1.875rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    #skills .grid,
    #projects .grid {
        grid-template-columns: 1fr;
    }
}

/* ========== UTILIDADES ========== */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.gap-3 {
    gap: 12px;
}

.gap-6 {
    gap: 24px;
}
