/* --- RESET & BASICS --- */
* { box-sizing: border-box; margin: 0; padding: 0; transition: all 0.3s ease; }
body { font-family: sans-serif; overflow-x: hidden; }

/* --- NAVIGATION (FIXED) --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-btn {
    background: none;
    border: none;
    color: #888;
    padding: 0 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover, .nav-btn.active { color: #fff; text-decoration: underline; }

/* --- SCHEDULE BUTTON --- */
.schedule-btn {
    position: fixed;
    top: 60px; /* Below the nav bar */
    right: 20px;
    background: #27ae60; /* Professional green */
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: sans-serif;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.schedule-btn:hover {
    background: #2ecc71;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.schedule-btn i {
    font-size: 1.1rem;
}

.whatsapp-btn {
    position: fixed;
    top: 110px; /* Below the schedule button */
    right: 20px;
    background: #25d366; /* WhatsApp green */
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: sans-serif;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.whatsapp-btn i {
    font-size: 1.1rem;
}

@media (max-width: 650px) {
    .schedule-btn {
        top: auto;
        bottom: 85px; /* Shifted up to make room for WhatsApp */
        right: 20px;
        font-size: 0.85rem;
        padding: 12px 20px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.4);
    }
    .whatsapp-btn {
        top: auto;
        bottom: 25px;
        right: 20px;
        font-size: 0.85rem;
        padding: 12px 20px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.4);
    }
}

/* --- VIEW CONTROLLER --- */
#app-container { margin-top: 50px; min-height: calc(100vh - 50px); }
.view { display: none; padding: 20px; animation: fadeIn 0.5s; width: 100%; box-sizing: border-box; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================
   MODE 1: PROFESSIONAL (CV Style)
   ========================================= */
body.mode-professional { background-color: #ffffff; color: #333; font-family: 'Georgia', serif; }
body.mode-professional #view-professional { display: block; max-width: 1100px; margin: 0 auto; padding: 30px 15px; }

.cv-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.cv-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

/* Custom scrollbar for sidebar */
.cv-sidebar::-webkit-scrollbar {
    width: 6px;
}

.cv-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cv-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.cv-sidebar::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.cv-main {
    flex: 1;
    min-width: 0;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}

.software-category {
    margin-bottom: 20px;
}

.software-category h5 {
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.software-category ul {
    list-style: none;
    padding: 0;
}

.software-category li {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #444;
}

.software-category li a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.software-category li a:hover {
    color: #e67e22;
}

.software-category i {
    width: 20px;
    text-align: center;
    color: #333;
    font-size: 1rem;
}

.software-category li a:hover i {
    color: #e67e22;
}

.software-category .years {
    margin-left: auto;
    font-size: 0.8rem;
    color: #888;
    font-family: sans-serif;
    font-weight: bold;
    white-space: nowrap;
}

.portrait-container {
    width: 100%;
    margin-bottom: 25px;
    border-radius: 50%;
    overflow: hidden;
    aspect-ratio: 1/1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #fff;
}

.cv-portrait {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #111;
    border-bottom: 2px solid #333;
    margin-bottom: 12px;
    padding-bottom: 5px;
    letter-spacing: 1.5px;
}

.sidebar-section p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
    margin-bottom: 8px;
    word-break: break-word;
}

.sidebar-section i {
    width: 20px;
    color: #333;
    font-size: 0.85rem;
}

.sidebar-section a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px dotted #888;
}

.sidebar-section a:hover {
    color: #000;
    border-bottom-style: solid;
    border-bottom-color: #000;
}

.visa-list {
    list-style: none;
    padding: 0;
}

.visa-list li {
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 6px;
    position: relative;
    padding-left: 20px;
}

.visa-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.cv-header { text-align: left; margin-bottom: 40px; }
.cv-header h1 { font-size: 2.8rem; text-transform: uppercase; letter-spacing: 2px; color: #111; margin-bottom: 10px; }
.cv-header p { font-size: 1.2rem; color: #666; font-style: italic; }

.cv-content { display: grid; gap: 40px; }

.cv-section h3 {
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 25px;
    padding-bottom: 10px;
    color: #222;
}

.cv-item { 
    margin-bottom: 30px; 
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 25px;
}
.cv-item .cv-text { flex: 1; }
.cv-item h4 { font-size: 1.2rem; color: #111; margin-bottom: 8px; }
.cv-item .date { color: #e67e22; font-weight: bold; font-size: 0.9rem; display: block; margin-bottom: 5px; font-family: sans-serif; }
.cv-item .location { color: #888; font-size: 0.85rem; display: block; margin-bottom: 10px; font-family: sans-serif; }
.cv-item p { line-height: 1.6; color: #444; text-align: justify; font-size: 1rem; }

.cv-logo-link { display: block; flex-shrink: 0; margin-top: 5px; }
.cv-logo-img { 
    max-width: 90px; 
    max-height: 90px; 
    width: auto; 
    height: auto; 
    object-fit: contain; 
    border-radius: 8px;
    filter: grayscale(20%);
    transition: all 0.3s;
    border: 1px solid #eee;
    padding: 5px;
    background: #fff;
}
.cv-logo-link:hover .cv-logo-img { transform: scale(1.05); filter: grayscale(0%); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

@media (max-width: 800px) {
    .cv-container {
        flex-direction: column;
        gap: 20px;
    }
    .cv-sidebar {
        flex: none;
        width: 100%;
        position: static;
        display: block;
        box-sizing: border-box;
        padding: 20px;
    }
    .portrait-container {
        max-width: 150px;
        margin: 0 auto 25px;
    }
    .sidebar-section {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    .sidebar-section h4 {
        display: block;
        width: 100%;
    }
    .cv-header { text-align: center; }
}

@media (max-width: 650px) {
    .nav-btn { padding: 0 8px; font-size: 0.8rem; }
    .cv-header h1 { font-size: 1.8rem; }
    .cv-item { flex-direction: column-reverse; gap: 15px; border-left: 2px solid #333; padding-left: 15px; }
    .cv-logo-link { margin-top: 0; }
    .cv-logo-img { max-width: 60px; }
    .portrait-container { max-width: 130px; }
    .cv-item p { text-align: left; }
}

/* =========================================
   MODE 2: CODING (Neocities / Retro)
   ========================================= */
body.mode-coding { background-color: #000; color: #0f0; font-family: 'Courier New', monospace; }
body.mode-coding #view-coding { display: block; }
body.mode-coding .nav-btn { font-family: 'Courier New', monospace; }

/* Scanline effect */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px; pointer-events: none; z-index: 900;
}

.retro-container { max-width: 900px; margin: 0 auto; border: 2px solid #0f0; padding: 20px; box-shadow: 0 0 20px #0f0; }
.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

.scrolling-text { background: #0f0; color: #000; font-weight: bold; font-size: 1.2rem; margin: 20px 0; }
.retro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.retro-box { border: 1px dashed #0f0; padding: 15px; background: rgba(0, 255, 0, 0.05); }
.retro-box.full-width { grid-column: 1 / -1; }
.retro-box h3 { border-bottom: 1px solid #0f0; margin-bottom: 10px; color: #0f0; }
.retro-box ul { list-style: none; }
.retro-box li { margin-bottom: 10px; line-height: 1.2; }
.retro-box li a { color: #0f0; text-decoration: none; font-weight: bold; border: 1px solid #0f0; padding: 2px 5px; margin-right: 5px; }
.retro-box li a:hover { background: #0f0; color: #000; }
.repo-meta { font-size: 0.8rem; opacity: 0.8; margin-top: 4px; }

@media (max-width: 600px) { .retro-grid { grid-template-columns: 1fr; } }

/* =========================================
   MODE 3: FUTURE (Medieval / Quest)
   ========================================= */
body.mode-future { 
    background-color: #2b2b2b; 
    color: #3e2723; 
    font-family: 'Palatino Linotype', 'Book Antiqua', serif; 
}
body.mode-future #view-future { display: block; height: 100%; }

.parchment {
    background: #fdf5e6;
    max-width: 800px;
    margin: 20px auto;
    padding: 40px;
    border: 10px double #8d6e63;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-radius: 5px;
    min-height: 80vh;
}

.timeline-nav { display: flex; justify-content: space-around; margin-bottom: 30px; border-bottom: 2px solid #8d6e63; padding-bottom: 10px; }
.time-btn {
    background: #8d6e63; color: #fff; border: 2px solid #5d4037;
    padding: 10px 20px; font-family: inherit; cursor: pointer; border-radius: 50%;
}
.time-btn:hover { background: #5d4037; transform: scale(1.1); }

/* 2D Map Simulation */
.map-container-2d {
    width: 100%;
    margin: 20px 0;
    background: #e3d5b8; /* Old paper water color */
    border: 2px solid #5d4037;
    padding: 10px;
}

#world-map {
    width: 100%;
    height: auto;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.2));
}

.country {
    fill: #c5b358; /* Default gold-ish beige */
    stroke: #5d4037;
    stroke-width: 2;
    transition: fill 0.5s, transform 0.3s;
}

/* FUTURE MODE SPECIFIC STYLE */
body.mode-future .parchment {
    background: #fefae0; /* Elegant Yellowish/Cream */
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    border: 5px solid #bc6c25;
    border-radius: 2px;
    box-shadow: 10px 10px 0px #dda15e;
}

.medieval-title {
    text-align: center;
    color: #283618;
    margin-bottom: 40px;
    text-transform: uppercase;
}

/* Vertical Timeline */
.vertical-timeline {
    position: relative;
    padding: 20px 0;
    margin-top: 20px;
}

.vertical-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 90px;
    height: 100%;
    width: 4px;
    background: #dda15e;
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    padding-left: 110px;
}

.timeline-year {
    position: absolute;
    left: 0;
    top: 5px;
    width: 80px;
    text-align: right;
    padding-right: 15px;
    font-weight: bold;
    font-size: 1.5rem;
    color: #bc6c25;
}

.timeline-content {
    background: rgba(221, 161, 94, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #bc6c25;
    display: flex;
    align-items: center;
    gap: 20px;
}

.timeline-content .text-content {
    flex: 1;
}

.timeline-content h3 {
    margin-bottom: 10px;
}

.timeline-content img {
    max-width: 150px;
    border-radius: 8px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .vertical-timeline::before {
        left: 10px;
    }
    .timeline-item {
        padding-left: 0;
    }
    .timeline-year {
        position: relative;
        left: 25px;
        top: 0;
        width: auto;
        text-align: left;
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    .timeline-content {
        margin-left: 25px;
        flex-direction: column;
    }
    .timeline-content img {
        width: 100%;
        max-width: none;
        margin-top: 15px;
    }
}


@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-10px); } }

.quest-log { background: rgba(141, 110, 99, 0.2); padding: 15px; border-radius: 8px; border: 1px dashed #5d4037; }

/* =========================================
   MODE 2: AUDIO (Demos) - Fun & Creative
   ========================================= */
body.mode-audio {
    background-color: #f0f4f8; /* Light blue-grey */
    color: #333;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', sans-serif;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
body.mode-audio #view-audio {
    display: block;
    max-width: 1200px;
    margin: 40px auto;
}

.audio-header {
    text-align: center;
    margin-bottom: 50px;
}
.audio-header h1 {
    font-size: 3rem;
    color: #ff6b6b;
    text-shadow: 2px 2px 0 #feca57;
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.demo-card {
    background: #fff;
    border: 2px solid #333;
    border-radius: 15px 5px 15px 5px;
    padding: 20px;
    box-shadow: 5px 5px 0px #333;
    transition: transform 0.2s;
}

.demo-card:hover {
    transform: rotate(2deg);
}

.demo-card-img {
    width: 100%;
    height: 180px;
    background-color: #eee;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.demo-card h3 {
    font-family: 'Permanent Marker', cursive; /* A more "handwritten" font */
    font-size: 1.8rem;
    color: #4834d4;
    margin-bottom: 10px;
}
.demo-card p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 20px;
}
.demo-card audio {
    width: 100%;
    filter: sepia(30%) contrast(110%);
}


/* =========================================
   MODE 4: PERSONAL (Blog Style)
   ========================================= */
body.mode-personal { background-color: #fafafa; color: #444; font-family: 'Helvetica Neue', sans-serif; }
body.mode-personal #view-personal { display: block; max-width: 1000px; margin: 0 auto; }

.blog-header { text-align: center; margin: 40px 0; }
.blog-header h1 { font-weight: 300; font-size: 3rem; color: #333; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.blog-card:hover { transform: translateY(-5px); }
.blog-img { height: 150px; width: 100%; }

.blog-card-content {
    padding: 15px;
    flex-grow: 1;
}

.blog-card h3 { padding: 0; font-size: 1.2rem; }
.blog-card p { padding: 0; margin-top: 10px; color: #777; font-size: 0.9rem; line-height: 1.5; }
.blog-card a { display: block; padding: 15px; text-align: right; text-decoration: none; color: #3498db; font-weight: bold; }

/* --- MODAL STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.close-modal {
    color: #333;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover { color: #e74c3c; }

#modal-body h1 { margin-bottom: 25px; font-size: 2.2rem; }
#modal-body p { font-size: 1.1rem; line-height: 1.7; margin-bottom: 20px; }
#modal-body .back-link { display: none; }

@media (max-width: 600px) {
    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
    }
    #modal-body h1 { font-size: 1.8rem; }
}
