@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

:root {
    --pixel-size: 4px;
    /* Dark Theme (Default) */
    --bg: #0a0e1a;
    --bg2: #111827;
    --bg3: #1a2235;
    --accent: #00ff88;
    --accent2: #00ccff;
    --accent3: #ff6b6b;
    --text: #e0e8ff;
    --text2: #8899bb;
    --border: #1e3a5f;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Light Theme */
.light-mode {
    --bg: #f0f4ff;
    --bg2: #ffffff;
    --bg3: #e1e7f5;
    --accent: #00a854;
    --accent2: #0077ee;
    --accent3: #ee4455;
    --text: #1a1f3a;
    --text2: #556688;
    --border: #c0cde0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Special Theme (Sakura Cyber) */
.special-mode {
    --bg: #0f0c29;
    --bg2: #1b1435;
    --bg3: #2a1b4d;
    --accent: #ff80bf; /* Pink Hair Color */
    --accent2: #80ffea; /* Cyan Eyes/Accent */
    --accent3: #9580ff; /* Purple Details */
    --text: #f1f1f1;
    --text2: #a29bfe;
    --border: #3d2c6e;
    --shadow: rgba(255, 128, 191, 0.2);
}

/* THEME DROPDOWN */
.theme-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    min-width: 140px;
    background: var(--bg2);
    border: 3px solid var(--border);
    box-shadow: 4px 4px 0px var(--shadow);
    z-index: 10002; /* Higher than progress bar */
    padding: 5px;
}

.dropdown-content.show {
    display: block;
}

.theme-option {
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px dashed var(--border);
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background: var(--bg3);
    color: var(--accent);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* THEME TRANSITION OVERLAY */
#theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 20000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.theme-switching #theme-transition-overlay {
    opacity: 1;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.5s ease, color 0.5s ease;
    image-rendering: pixelated;
    overflow-x: hidden;
    position: relative;
}

/* BACKGROUND ANIMATION */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    opacity: 0.1;
    z-index: -1;
    transform: perspective(500px) rotateX(60deg) translateY(0);
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* SCANLINES EFFECT */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.05) 2px,
        rgba(0, 0, 0, 0.05) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 200px 40px 200px;
    flex: 1 0 auto;
}

/* NAVBAR / TOPBAR */
.topbar {
    background: var(--bg2);
    border-bottom: 2px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    margin-left: 20px;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav a:hover, .nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

/* RESPONSIVE NAVBAR */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-container {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg2);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        margin-left: 0;
    }

    .nav-container.open {
        display: flex;
        z-index: 9999;
        box-shadow: 0 10px 15px var(--shadow);
    }

    .nav {
        flex-direction: column;
        width: 100%;
    }

    .nav a {
        width: 100%;
        padding: 12px 8px;
        border-bottom: 1px solid var(--bg3);
    }
}

/* GITHUB-LIKE 2-COLUMN LAYOUT */
.main-layout {
    display: flex;
    gap: 32px;
    padding: 40px 200px;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

.content-area {
    flex-grow: 1;
    min-width: 0; /* Prevent overflow */
    animation: contentFadeIn 0.5s ease-out forwards;
}

/* SPA TRANSITION ANIMATIONS FOR CONTENT AREA */
.content-exit {
    animation: contentFadeOut 0.25s ease-in forwards !important;
}

.content-enter {
    animation: contentFadeIn 0.3s ease-out forwards !important;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes contentFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 20px 16px;
    }
    .sidebar {
        width: 100%;
    }
}

/* SIDEBAR PROFILE */
.sidebar-avatar {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg2);
    overflow: hidden;
    margin-bottom: 16px;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.sidebar-username {
    font-size: 20px;
    color: var(--text2);
    margin-bottom: 16px;
}

.sidebar-bio {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.5;
}

.sidebar-info {
    font-size: 14px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* GITHUB-STYLE PROJECT LIST */
.repo-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.repo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.repo-title {
    font-size: 20px;
    color: var(--accent2);
    text-decoration: none;
    font-weight: 600;
}

.repo-title:hover {
    text-decoration: underline;
}

.repo-status {
    font-size: 12px;
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text2);
}

.repo-description {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 12px;
}

.repo-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text2);
}

.repo-lang {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* TOP PROGRESS BAR */
#top-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 10001;
    width: 0;
    transition: width 0.3s;
}

/* 8-BIT BUTTONS */
.btn, .btn-primary, .btn-danger, .toggle-btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    position: relative;
    outline: none;
    margin: 5px;
    transition: transform 0.1s;
}

/* Generic Button Style */
.btn {
    background: var(--bg3);
    color: var(--text);
    box-shadow: 
        inset -4px -4px 0px 0px #00000040,
        4px 4px 0px 0px var(--border);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 
        inset -4px -4px 0px 0px #00000040,
        4px 4px 0px 0px var(--accent2);
}

.btn-danger {
    background: var(--accent3);
    color: #fff;
    box-shadow: 
        inset -4px -4px 0px 0px #00000040,
        4px 4px 0px 0px #000;
}

.btn:active, .btn-primary:active, .btn-danger:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* THEME TOGGLE BUTTON */
.toggle-btn {
    background: var(--accent2);
    color: #000;
    font-size: 8px;
    box-shadow: 4px 4px 0px 0px var(--border);
}

/* CARDS */
.card {
    background: var(--bg2);
    border: 4px solid var(--border);
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 8px 8px 0px 0px var(--shadow);
}

.card-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

/* PROFILE SECTION */
.profile-header {
    display: flex;
    gap: 30px;
    align-items: center;
}

.avatar-pixel img {
    width: 120px;
    height: 120px;
    border: 4px solid var(--accent);
    background: var(--bg3);
    object-fit: cover;
}

.glitch {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    color: var(--accent);
    text-shadow: 3px 3px 0px var(--accent2);
    margin-bottom: 10px;
}

/* PROJECTS GRID */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-image {
    width: 100%;
    height: 200px;
    background: var(--bg3);
    border-bottom: 4px solid var(--border);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

/* SKILLS SECTION */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-item {
    margin-bottom: 15px;
}

.progress-bar-container {
    height: 20px;
    background: var(--bg3);
    border: 3px solid var(--border);
    position: relative;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent2);
    box-shadow: inset -4px 0px 0px rgba(0,0,0,0.2);
}

/* FORMS */
.admin-form .form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--accent2);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px;
    background: var(--bg3);
    border: 3px solid var(--border);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* TERMINAL STYLE */
.terminal {
    background: #000;
    color: var(--accent);
    padding: 15px;
    font-family: 'Share Tech Mono', monospace;
    border: 2px solid var(--accent);
    line-height: 1.5;
}

.t-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* TAGS */
.tag-8bit {
    display: inline-block;
    padding: 4px 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 6px;
    background: var(--bg3);
    border: 2px solid var(--border);
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ADMIN TABLE */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th {
    background: var(--bg3);
    color: var(--accent2);
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 15px;
    text-align: left;
    border: 2px solid var(--border);
}

.admin-table td {
    padding: 15px;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 4px 10px;
    border: 1px solid var(--border);
    font-size: 8px;
    font-family: 'Press Start 2P', cursive;
}

/* FOOTER */
.footer {
    margin-top: auto;
    padding: 30px 20px;
    background: var(--bg2);
    border-top: 2px solid var(--border);
    text-align: center;
    color: var(--text2);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .glitch {
        font-size: 18px;
    }
    
    .container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .nav a {
        font-size: 6px;
        padding: 6px 8px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}
