/* --- style.css (Optimized & Organized) --- */

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Light Mode (Default) */
    --primary-color: #2563eb;
    --secondary-color: #1e293b;
    --dim-color: #cbd5e1;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #334155;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 8px;
}

body.dark-mode {
    --primary-color: #60a5fa;
    --secondary-color: #f1f5f9;
    --dim-color: #475569;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #cbd5e1;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; transition: all 0.3s ease; }

body { 
    font-family: var(--font-main); 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.6; 
    overflow-x: hidden;
    zoom: 1.0; /* Prevents weird zoom issues on some browsers */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* =========================================
   2. GLOBAL LAYOUT (Header, Footer, Sections)
   ========================================= */
header { 
    background-color: var(--card-bg); 
    box-shadow: var(--shadow); 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 1000; 
}

nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 1rem 2rem; 
}

.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a:hover { color: var(--primary-color); }

/* Standard Buttons */
button, .btn {
    border: 1px solid var(--text-color);
    color: var(--text-color);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}
button:hover { background-color: var(--bg-color); opacity: 0.8; }

.btn { 
    background-color: var(--primary-color); 
    color: #fff; 
    border: none; 
    padding: 0.75rem 1.5rem; 
    border-radius: var(--border-radius); 
    display: inline-block;
}

/* Sections & Typography */
section { padding: 4rem 2rem; max-width: 1100px; margin: 0 auto; }
h2 { font-size: 2rem; text-align: center; margin-bottom: 3rem; color: var(--secondary-color); }
footer { background-color: var(--secondary-color); color: var(--bg-color); text-align: center; padding: 2rem; margin-top: 2rem; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg) 100%);
}
.hero h1 { font-size: 3rem; margin-bottom: 1rem; color: var(--secondary-color); }
.hero p { font-size: 1.25rem; margin-bottom: 2rem; max-width: 600px; }

/* --- SOCIAL LINKS (Hero Section) --- */

.social-container {
    display: flex;
    gap: 1.5rem; /* Space between icons */
    margin-top: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Circle shape */
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.social-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor; /* Uses text color */
}

/* Hover Effect (Normal Mode) */
.social-btn:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color);
    color: #ffffff; /* Icon turns white */
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* --- TERMINAL MODE OVERRIDES --- */
body.terminal-mode .social-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 0; /* Square shape */
    color: var(--primary-color);
    box-shadow: none;
}

body.terminal-mode .social-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color); /* Icon turns black */
    box-shadow: var(--glow);
}

/* Mobile Center Fix */
@media (max-width: 1024px) {
    .social-container {
        justify-content: center; /* Center icons on mobile */
    }
}

/* =========================================
   3. COMPONENTS: CARDS & GRIDS
   ========================================= */

/* Shared Styles for ALL Cards (Projects, Skills, Flowchart Nodes) */
.project-card, .skill-card, .flow-node, .info-terminal-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

/* Grids */
.project-grid, .skills-grid { 
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 2rem; 
}

/* --- Project Cards Specifics --- */
.project-card { padding: 0; overflow: hidden; } /* Padding 0 for images */
.project-card .project-info { padding: 1.5rem; }

/* Interactive Hover for Projects */
.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
a.project-card { display: block; height: 100%; }

/* --- Skill Cards Specifics --- */
.skill-card {
    padding: 1rem;
    width: 110px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.skill-card:hover { transform: translateY(-5px); }
.skill-card img { width: 50px; height: 50px; margin-bottom: 0.5rem; object-fit: contain; }
.skill-card p { font-weight: bold; font-size: 0.9rem; margin: 0; }

/* --- SOFT SKILLS & INTERESTS (Fixed Text Color) --- */

/* 1. Normal Mode Rules (Applies to both Light & Dark themes) */
body:not(.terminal-mode) .soft-skill-tag,
body:not(.terminal-mode) .skill-tag {
    /* Background is ALWAYS Dark Slate Blue */
    background-color: #1e293b !important; 
    
    /* Text is ALWAYS White (This fixes your issue) */
    color: #ffffff !important;            
    
    /* Standard styling */
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    box-shadow: var(--shadow);
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid transparent;
    display: inline-block;
    transition: transform 0.2s, background-color 0.2s;
}

/* Hover Effect */
body:not(.terminal-mode) .soft-skill-tag:hover,
body:not(.terminal-mode) .skill-tag:hover {
    background-color: #334155 !important; /* Lighter Blue */
    transform: translateY(-3px);
}

/* 2. Terminal Mode Overrides (The Hacker Look) */
body.terminal-mode .soft-skill-tag,
body.terminal-mode .skill-tag {
    background: transparent !important;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important; /* Text turns Green/Amber here */
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Terminal Brackets */
body.terminal-mode .soft-skill-tag::before,
body.terminal-mode .skill-tag::before { content: "< "; opacity: 0.7; }

body.terminal-mode .soft-skill-tag::after,
body.terminal-mode .skill-tag::after { content: " />"; opacity: 0.7; }

/* --- Academic Flowchart --- */
.flowchart-container { display: flex; justify-content: center; align-items: center; gap: 0.5rem; padding: 1rem 0; overflow-x: auto; }
.flow-node { padding: 1rem; width: 200px; min-width: 180px; text-align: center; }
.flow-node:hover { transform: scale(1.02); border-color: var(--primary-color); }
.flow-node.active-node { border: 2px solid var(--primary-color); }

.node-icon { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; color: var(--text-color); border-bottom: 1px solid var(--dim-color); display: inline-block; }
.school-name { font-weight: bold; margin: 0.5rem 0; font-size: 0.9rem; color: var(--secondary-color); }
.year { font-size: 0.8rem; opacity: 0.8; }
.status-badge { background: var(--primary-color); color: #fff; padding: 2px 8px; font-size: 0.7rem; font-weight: bold; border-radius: 4px; display: inline-block; margin-top: 0.5rem; }
.flow-arrow { font-size: 1rem; letter-spacing: -2px; color: var(--primary-color); animation: pulse 1.5s infinite; }

/* --- Info Terminal Card --- */
.info-terminal-card { padding: 2rem; max-width: 800px; margin: 0 auto 2rem auto; border: 1px dashed var(--dim-color); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; text-align: left; }
.info-item .label { color: var(--primary-color); font-weight: bold; display: block; font-size: 0.8rem; text-transform: uppercase; }

/* --- Fork-in-Road --- */
.fork-container { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; padding: 1rem; border-top: 1px dashed var(--dim-color); border-bottom: 1px dashed var(--dim-color); background: rgba(0,0,0,0.03); }
.fork-btn { font-size: 1.1rem; padding: 1rem 2rem; color: var(--dim-color); border-color: transparent; text-transform: uppercase; }
.fork-btn:hover { color: var(--primary-color); transform: scale(1.05); }
.fork-btn.active-fork { border: 2px solid var(--primary-color); color: var(--primary-color); background: rgba(255, 255, 255, 0.1); }
.fork-divider { color: var(--dim-color); font-family: monospace; font-weight: bold; }

/* --- Contact Form --- */
.contact-form { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.form-row { display: flex; gap: 1.5rem; width: 100%; }
.form-input { width: 100%; padding: 1.2rem; background-color: var(--card-bg); border: 1px solid var(--dim-color); color: var(--text-color); border-radius: var(--border-radius); font-size: 1rem; }
.form-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 10px rgba(0,0,0,0.1); }

/* --- Images & Slideshow --- */
.card-img { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--dim-color); opacity: 0.8; transition: all 0.3s ease; }
.project-card:hover .card-img { opacity: 1; height: 190px; }

.img-slider { position: relative; width: 100%; height: 180px; overflow: hidden; border-bottom: 1px solid var(--dim-color); }
.slide-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: slideCycle 18s infinite; }
.project-card:hover .slide-img { animation-play-state: paused; filter: none; opacity: 1; }

/* =========================================
   4. TERMINAL MODE (The "Hacker" Override)
   ========================================= */
body.terminal-mode {
    --primary-color: #00ff00;
    --secondary-color: #00ff00;
    --dim-color: #008f11;
    --bg-color: #0d0d0d;
    --card-bg: #000000;
    --text-color: #00ff00;
    --shadow: none;
    --font-main: 'Courier New', monospace;
    --border-radius: 0px;
    --glow: 0 0 5px #00ff00;
}

body.terminal-mode.amber-mode {
    --primary-color: #ffb000;
    --secondary-color: #ffb000;
    --dim-color: #bfa300;
    --text-color: #ffb000;
    --glow: 0 0 5px #ffb000;
}

/* --- Terminal Layout Overrides --- */
body.terminal-mode nav,
body.terminal-mode section,
body.terminal-mode .hero {
    max-width: 100%; margin: 0; text-align: left; justify-content: flex-start;
}
body.terminal-mode nav { padding: 1rem 2rem; gap: 3rem; }

/* --- Terminal Hero --- */
body.terminal-mode .hero { padding-top: 8rem; padding-left: 2rem; border-bottom: 1px dashed var(--primary-color); align-items: flex-start; }
body.terminal-mode .hero h1 { font-family: 'VT323', monospace; font-size: 5rem; text-transform: uppercase; text-shadow: 4px 4px 0 rgba(0,0,0,0.5); line-height: 1; margin-left: -4px; }
body.terminal-mode .hero h1::after { content: "_"; animation: blink 1s infinite; }
body.terminal-mode .hero p { border-left: 4px solid var(--primary-color); padding-left: 1rem; max-width: 800px; }

/* --- Terminal Components --- */
body.terminal-mode .logo::before { content: "> "; }
body.terminal-mode h2 { text-align: left; border-bottom: 2px solid var(--primary-color); display: inline-block; width: 100%; }
body.terminal-mode h2::before { content: "./"; }
body.terminal-mode .project-grid, body.terminal-mode .skills-grid { justify-content: flex-start; }
body.terminal-mode footer { background-color: black; color: var(--primary-color); border-top: 1px solid var(--primary-color); text-align: left; }

/* --- Terminal Cards (Hard Edges & Wireframes) --- */
body.terminal-mode .project-card, 
body.terminal-mode .skill-card,
body.terminal-mode .flow-node,
body.terminal-mode .info-terminal-card,
body.terminal-mode .fork-btn,
body.terminal-mode .status-badge,
body.terminal-mode .soft-skill-tag,
body.terminal-mode .skill-tag, /* <--- ADDED THIS */
body.terminal-mode .form-input {
    border-radius: 0 !important;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    box-shadow: none;
    font-family: 'Courier New', monospace;
}

/* Add the brackets for .skill-tag in Terminal Mode */
body.terminal-mode .skill-tag::before { content: "< "; opacity: 0.7; }
body.terminal-mode .skill-tag::after { content: " />"; opacity: 0.7; }

/* Hover Effects (Invert) */
body.terminal-mode .project-card:hover,
body.terminal-mode .skill-card:hover {
    background-color: var(--primary-color);
    color: var(--bg-color); /* Black text */
    box-shadow: var(--glow);
    transform: translateY(-4px);
}
body.terminal-mode .project-card:hover p,
body.terminal-mode .skill-card:hover p {
    color: var(--bg-color); /* Ensure inner text turns black */
}

/* Terminal Soft Skills */
body.terminal-mode .soft-skill-tag::before { content: "< "; opacity: 0.7; }
body.terminal-mode .soft-skill-tag::after { content: " />"; opacity: 0.7; }

/* Terminal Images */
body.terminal-mode .card-img, 
body.terminal-mode .img-slider { 
    border-bottom: 1px dashed var(--primary-color); opacity: 0.7; 
}
body.terminal-mode .skill-card img {
    filter: grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(85deg) brightness(0.8);
    opacity: 0.8;
}
body.terminal-mode.amber-mode .skill-card img {
    filter: grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(350deg) brightness(1.0);
}

/* Scanline Overlay */
body.terminal-mode::after {
    content: " "; display: block; position: fixed; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px; pointer-events: none; z-index: 9999;
}

/* --- HERO SPLIT LAYOUT (Side-by-Side) --- */

.hero-split {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; /* Pushes them apart nicely */
    gap: 2rem;                      /* Space between text and image */
    max-width: 1400px;              /* INCREASED from 1200px to give more room */
    width: 95%;                     /* Uses 95% of screen width */
    margin: 0 auto;                 /* Centers the block */
}

.hero-text {
    flex: 1;             /* Takes available space */
    text-align: left;
    min-width: 350px;    /* SAFETY: Text can never be smaller than this */
}

/* Ensure the ASCII art scales down if needed */
.ascii-wrapper {
    font-size: 10px;           /* Adjust this if ASCII is too big */
    overflow-x: visible;       /* Allow it to show fully */
    white-space: pre;
}


.profile-img {
    /* Desired size on big screens */
    width: 350px;        
    height: 350px;       
    
    /* RESPONSIVE SAFETY: Never take up more than 40% of the screen width */
    max-width: 40vw;     
    max-height: 40vw;    
    
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    flex-shrink: 0;      /* Prevents the image itself from getting squashed */
}

/* =========================================
   5. ANIMATIONS & MEDIA QUERIES
   ========================================= */
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
@keyframes slideCycle { 0% { opacity: 0; } 5% { opacity: 1; } 33% { opacity: 1; } 38% { opacity: 0; } 100% { opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes flicker { 0% { opacity: 1; } 50% { opacity: 0.8; } 100% { opacity: 1; } }

@media (max-width: 768px) { 
    .nav-links { display: none; } 
    .flowchart-container { flex-direction: column; }
    .flow-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
    .info-grid { grid-template-columns: 1fr; }
    .fork-container { flex-direction: column; }
    .fork-divider { transform: rotate(90deg); }
    .form-row { flex-direction: column; gap: 1rem; }
}