/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(25, 25, 35, 0.6);
    --accent-red: #ff3b5c;
    --accent-green: #00ff88;
    --accent-blue: #00d4ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Body y Background */
body {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 50%, #0a0a0f 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 59, 92, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container-fluid {
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 3px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.sidebar-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-red);
    box-shadow: 0 0 30px rgba(255, 59, 92, 0.4);
    transition: all 0.4s ease;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 59, 92, 0.4); }
    50% { box-shadow: 0 0 50px rgba(255, 59, 92, 0.8); }
}

.sidebar-logo img:hover {
    transform: scale(1.05) rotate(5deg);
    border-color: var(--accent-green);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.6);
}

.sidebar-logo h3 {
    margin-top: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-red);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 59, 92, 0.1);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link:hover::before,
.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link i {
    font-size: 1.25rem;
}

/* Mobile Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1100;
    background: rgba(255, 59, 92, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--accent-red);
    transform: scale(1.05);
}

.sidebar-toggle.active {
    left: 250px;
}

/* Main Content */
main {
    margin-left: 280px;
    padding: 3rem 2rem;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(25, 25, 35, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 59, 92, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero img {
    width: 140px;
    height: 140px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 59, 92, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Writeup Cards */
.writeup {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out backwards;
}

.writeup::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 59, 92, 0.1), transparent);
    transition: left 0.5s ease;
}

.writeup:hover::before {
    left: 100%;
}

.writeup:hover {
    transform: translateY(-8px);
    border-color: var(--accent-red);
    box-shadow: 0 20px 60px rgba(255, 59, 92, 0.3);
}

.writeup .d-flex {
    position: relative;
    z-index: 1;
}

.writeup img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.writeup:hover img {
    border-color: var(--accent-red);
    transform: scale(1.05) rotate(3deg);
}

.writeup h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.writeup p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.writeup .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-red) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.writeup .btn-link:hover {
    color: var(--accent-green) !important;
    gap: 0.75rem;
}

.writeup .btn-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.writeup .btn-link:hover::after {
    transform: translateX(4px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.writeup:nth-child(1) { animation-delay: 0.1s; }
.writeup:nth-child(2) { animation-delay: 0.2s; }
.writeup:nth-child(3) { animation-delay: 0.3s; }
.writeup:nth-child(4) { animation-delay: 0.4s; }
.writeup:nth-child(5) { animation-delay: 0.5s; }
.writeup:nth-child(6) { animation-delay: 0.6s; }

/* Pre/Code Blocks */
pre {
    border-radius: 10px;
    background-color: #111111;
    border: 1px solid #1f1f1f;
    color: #c9c9c9;
    page-break-inside: avoid;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 100%;
    overflow: auto;
    padding: 15px;
    display: block;
}

pre code {
    background-color: inherit;
    border: none;
    padding: 0;
    display: inline;
    line-height: inherit;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero img {
        width: 100px;
        height: 100px;
    }

    main {
        padding: 2rem 1rem;
    }

    .writeup {
        padding: 1rem;
    }

    .writeup img {
        width: 60px;
        height: 60px;
    }

    .writeup h3 {
        font-size: 1.1rem;
    }

    .writeup p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 250px;
    }

    .writeup .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .writeup img {
        margin: 0 auto 1rem;
    }
}

/* Utility Classes */
.text-light {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-danger {
    color: var(--accent-red) !important;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.me-3 { margin-right: 1rem; }

.rounded-circle {
    border-radius: 50%;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.p-0 {
    padding: 0;
}

.text-decoration-none {
    text-decoration: none;
}

