/* CSS Variables & Theme */
:root {
    --primary-color: #6C63FF;
    /* Example primary color */
    --secondary-color: #FF6584;
    /* Example accent */
    --bg-color: #f8f9fa;
    /* Paper background */
    --text-color: #333;
    --text-muted: #666;
    --sidebar-bg: #2c2c54;
    --sidebar-text: #fff;
    --card-bg: #fff;
    --grid-dot-color: #ccc;
    --margin-line-color: #e5e5e5;
    /* Red margin line */
    --font-main: 'Outfit', sans-serif;
    --font-hand: 'Permanent Marker', cursive;
    --radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1e1e2e;
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --sidebar-bg: #11111b;
    --card-bg: #2a2a3b;
    --grid-dot-color: #444;
    --grid-dot-color: #444;
    --margin-line-color: #444;
    --secondary-color: #2DD4BF;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;

}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    background-image: radial-gradient(var(--grid-dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;

}

/* Layout Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;


}

/* Top Bar (Floating Capsule) */
.top-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
    max-width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 50px;
    /* Oval shape */
    border: 1px solid var(--margin-line-color);
    transition: all 0.3s ease;

}

/* Translucent effect on scroll */
/* Translucent effect on scroll */
.top-bar.scrolled {
    width: 100%;
    /* Full width */
    max-width: 100%;
    /* Full width */
    top: 0;
    /* Stick to very top */
    border-radius: 0;
    /* Remove oval shape */
    left: 0;
    transform: none;
    /* Reset centering transform */
    background: rgba(255, 255, 255, 0.05) !important;
    /* Subtle tint for visibility */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    /* Safari support */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 2rem;
    /* Slightly more padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    /* Stronger bottom border */
    border-top: none;
    border-left: none;
    border-right: none;
}

[data-theme="dark"] .top-bar.scrolled {
    background: rgba(20, 20, 30, 0.2) !important;
    /* Darker tint for contrast */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo */
.logo-container {
    margin-right: 3rem;
    /* Add breathing room between logo and controls */
}

.logo-text {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.nav-logo {
    height: 30px;
    /* Adjust based on actual logo */
    width: auto;
}

/* Footer Logo */
.logo-text-footer {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    color: var(--text-muted);
}

.footer-logo {
    height: 40px;
    margin-bottom: 0.5rem;
}


/* Controls & Lang Switcher */
.controls {
    display: flex;
    gap: 2rem;
    /* Increased gap */
    align-items: center;
}

/* Theme Toggle with Images */
.theme-toggle-btn {
    border: none;
    background: transparent;
    padding: 0;
    width: 45px;
    /* Increased from 32px */
    height: 45px;
    /* Increased from 32px */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Show Moon in Light Mode (Default) */
.moon-img {
    display: block;
}

.sun-img {
    display: none;
}

/* Show Sun in Dark Mode */
[data-theme="dark"] .moon-img {
    display: none;
}

[data-theme="dark"] .sun-img {
    display: block;
}

.theme-toggle-btn:hover .theme-img {
    transform: rotate(15deg) scale(1.1);
}

.icon-btn {
    background: none;
    border: 2px solid var(--text-muted);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.icon-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.lang-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ES-EN Oval Group */
.lang-group-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-color);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--text-muted);
}

.lang-opt {
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
}

.separator {
    opacity: 0.3;
}

.lang-opt.active {
    opacity: 1;
    color: var(--primary-color);
    font-weight: bold;
}

.lang-opt:hover {
    opacity: 0.8;
}

/* JP Circle */
.lang-jp-circle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    background: var(--bg-color);
    cursor: pointer;
    /* Change to pointer if clickable in future */
    opacity: 0.6;
    transition: 0.3s;
}

.lang-jp-circle.active,
.lang-jp-circle:hover {
    opacity: 1;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 0 8px rgba(255, 101, 132, 0.4);
    /* Glow effect */
}


/* Main Layout: Sidebar vs Content */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    margin-top: 0;
    /* Remove margin so content starts at top (under header) */

}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    /* Reduced padding */
    transition: transform 0.3s ease;
    flex-shrink: 0;

}

.profile-mini {
    text-align: center;
    margin-bottom: 1rem;
    /* Reduced margin */
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius);
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.2rem;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.5);
    transition: 0.3s;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* Notebook Content Area */
.notebook-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-y: auto;
    padding: 120px 2rem 2rem 2rem;
    /* Top padding compenstates for fixed header */
}

/* Paper Margins Effect */
.margin-line {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--margin-line-color);
    z-index: 0;
    opacity: 0.5;

}

.left-line {
    left: 280px;
}

/* Adjust based on sidebar width + padding */
.right-line {
    right: 40px;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Sections */
.section {
    padding: 4rem 0;
    min-height: 80vh;
    border-bottom: 1px dashed var(--borderColor);

    /* Add border color var if needed */
}

.section-title {
    font-family: var(--font-primary);
    /* Changed to modern/formal font */
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    font-weight: 700;
    /* Bold for hierarchy */
    border-bottom: 3px solid var(--secondary-color);
}

/* Hero Section */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.badge {
    background: var(--secondary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 1rem;

}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--primary-color);
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--secondary-color);
    opacity: 0.3;
    z-index: -1;
    transform: rotate(-2deg);
}

.hero-text .role {
    font-size: 2.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero-text .description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 400px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 0 #4a47a3;
    /* Button depth */
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #4a47a3;
}

.primary-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #4a47a3;
}

.secondary-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--text-muted);
}

.secondary-btn:hover {
    background: var(--text-muted);
    color: #fff;
}

.icon-only {
    padding: 0.8rem;
    font-size: 1.2rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--text-muted);
}

.image-frame {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto;
    background: transparent;
    /* Remove background so flip looks clean */
    border: 2px solid var(--text-color);
    /* Keep border on frame if desired, or move to faces */
    /* If border should rotate with it, keep it. If border is static frame, keep it here. 
       Let's keep the frame style but make sure inner flips inside it */
    padding: 0;
    /* Remove padding for full image cover */
    box-shadow: 10px 10px 0 var(--secondary-color);
    transform: rotate(3deg);
    transition: transform 0.3s;
    /* Rotate hover effect for frame itself */
    perspective: 1000px;
    /* Essential for 3D flip */
}

/* Hover effect for the whole frame rotation (tilt) */
.image-frame:hover {
    transform: rotate(0deg);
}

/* FLIP CARD LOGIC */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.image-frame:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow: hidden;
    /* Added to keep children inside rounded corners */
}

/* FRONT */
.flip-card-front {
    background-color: transparent;
    color: black;
}

/* BACK */
.flip-card-back {
    background-color: var(--card-bg);
    color: var(--text-color);
    transform: rotateY(180deg);
    text-align: center;
}

/* Gafete (ID Badge) Style overrides */
.flip-card-back.gafete-style {
    background: #0d0d12;
    /* Dark sci-fi background */
    color: #00f3ff;
    /* Neon Cyan text */
    padding: 0;
    justify-content: flex-start;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    position: relative;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
    /* Fallback to monospace if font not loaded, or use system mono */
}

/* Glass/Mica Effect Overlay */
.flip-card-back.gafete-style::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 100%;
    background: linear-gradient(105deg,
            rgba(255, 255, 255, 0) 20%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0) 45%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 55%);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 10;
}

/* Lanyard Hole (Tech Style) */
.flip-card-back.gafete-style::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 6px;
    background: #1a1a2e;
    border: 1px solid #555;
    border-radius: 4px;
    z-index: 11;
    box-shadow: inset 0 0 5px #000;
}

/* Dark Theme Adjustment - keep it consistent since gamer style is usually dark */
[data-theme="dark"] .flip-card-back.gafete-style {
    background: #050510;
    border-color: #bc13fe;
    /* Purple neon for dark mode variance? Or keep cyan. Let's keep consistent tech feel. */
    color: #e0e0e0;
}

.gafete-header {
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), rgba(0, 243, 255, 0.3), rgba(0, 243, 255, 0.1));
    color: #00f3ff;
    padding: 35px 15px 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'Courier New', Courier, monospace;
    /* Tech font feel */
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
}

.gafete-body {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    /* Reduced gap */
    flex-grow: 1;
    width: 100%;
    overflow: hidden;
    /* Prevent spill */
}



.gafete-name {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Tech Stat Bar */
.tech-stat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80%;
    font-family: monospace;
    font-size: 0.8rem;
    color: #00f3ff;
    margin: 5px 0;
}

.stat-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: #00f3ff;
    box-shadow: 0 0 5px #00f3ff;
}

.gafete-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.gafete-info {
    font-size: 0.8rem;
    margin-top: 10px;
    line-height: 1.4;
    color: #ccc;
    font-family: sans-serif;
}

.gafete-footer {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-deco-lines {
    display: flex;
    gap: 5px;
}

.tech-deco-lines span {
    width: 30px;
    height: 4px;
    background: #00f3ff;
    opacity: 0.5;
    border-radius: 2px;
}

.tech-deco-lines span:nth-child(2) {
    width: 10px;
    opacity: 0.8;
}

.tech-deco-lines span:nth-child(3) {
    width: 50px;
    opacity: 0.3;
}

.hero-img-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #aaa;
}

/* Sidebar Avatar */
.sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary-color);
}

/* Cards (Generic) */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Skills Grid */
.skills-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.skill-card {
    text-align: center;
    /* keep icon/title centered */
    padding: 1.5rem;
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.skill-card h3 {
    margin-bottom: 0.5rem;
    font-family: var(--font-primary);
    /* Changed to modern/formal font */
    font-size: 1.3rem;
    font-weight: 700;
}

.skill-card ul {
    list-style: none;
    /* Remove default bullets */
    padding: 0;
    margin: 0;
    text-align: left;
    /* Align list text to left */
}

.skill-card li {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1.2rem;
}

/* Custom bullet */
.skill-card li::before {
    content: "•";
    /* or use a character/icon */
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Project Flip Card */
.project-card {
    overflow: visible;
    /* Allow scale effect to show outside */
}

.project-flip-container {
    perspective: 1000px;
    width: 100%;
    height: 180px;
    /* Adjust height as needed */
    position: relative;
    border-radius: var(--radius) var(--radius) 0 0;
    cursor: pointer;
}

.project-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s, box-shadow 0.3s;
    transform-style: preserve-3d;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Hover Effect: Scale & Rotate */
.project-flip-container:hover .project-flip-inner {
    transform: scale(1.05) rotateY(180deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.project-flip-front,
.project-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

/* Front: Image */
.project-flip-front {
    background-color: #eee;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Back: Tech Stack */
/* Back: Tech Stack */
/* Back: Tech Stack */
.project-flip-back {
    background-color: #222;
    /* Dark background to reduce luminosity */
    border: 2px solid var(--secondary-color);
    /* Mint accent border */
    color: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    /* Context for absolute bg */
}

/* Dimmed Background Image on Back */
.back-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    /* More opaque (less transparent) */
    filter: grayscale(100%);
    /* Optional: B&W for better text contrast */
    z-index: 1;
}

.project-flip-back h4 {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    /* On top of bg */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.project-flip-back ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    z-index: 2;
    /* On top of bg */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* Tech Bubbles */
.project-flip-back li {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.project-info {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Project Actions (Icons) */
.project-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
    /* or center */
}

.action-btn {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
}

.action-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Education */
.education-list {
    list-style: none;
}

.edu-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 1.5rem;
}

.edu-item:last-child {
    margin-bottom: 0;
}

.year {
    font-weight: bold;
    color: var(--secondary-color);
    min-width: 120px;
}

/* Contact */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group input,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid var(--margin-line-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Contact form submit button */
.contact-form button[type="submit"] {
    display: block;
    margin: 0.5rem auto 0;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
}

/* Footer */
.main-footer {
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 2px solid var(--margin-line-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
    align-items: center;
    /* Ensure logo and icons align nicely */
    justify-content: center;
}

.social-links a {
    color: var(--text-color);
    transition: 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Mobile & Responsiveness */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        /* Hide sidebar by default */
        top: 0;
        bottom: 0;
        z-index: 200;
        width: 80%;
        max-width: 300px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-only {
        display: block;
    }

    .notebook-content {
        padding: 1rem;
    }

    .margin-line {
        display: none;
        /* Hide margin lines on mobile to save space */
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .top-bar {
        min-width: unset;
        width: 96%;
        padding: 0.4rem 0.6rem;
    }

    .logo-container {
        margin-right: 0;
    }

    .nav-logo {
        height: 20px;
    }

    .controls {
        gap: 0.4rem;
    }

    .theme-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .lang-group-pill {
        padding: 2px 6px;
        font-size: 0.75rem;
    }

    .lang-jp-circle {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .hero-text h1 {
        font-size: 2.1rem;
    }

    .hero-text .description {
        margin: 0 auto 3rem auto;
    }

    .hero-btns {
        justify-content: center;
    }

    /* Fix timeline amontonado on mobile */
    .edu-item {
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 1.2rem;
    }

    .year {
        min-width: unset;
        font-size: 0.9rem;
    }

    .image-frame {
        width: 250px;
        height: 350px;
    }
}

/* ===== Success Modal ===== */
.success-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.success-modal-box {
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(108, 99, 255, 0.25);
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.success-modal-box h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.success-modal-box p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}