:root {
    --primary-color: #00f3ff;
    /* Cyan for AI/Energy */
    --secondary-color: #bd00ff;
    /* Electric Purple */
    --text-color: #f3f4f6;
    /* Light text for dark mode */
    --bg-color: #050510;
    /* Darker Deep Blue/Black */
    --card-bg: rgba(5, 5, 16, 0.85);
    /* Semi-transparent dark card */
    --accent-color: #00f3ff;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: #000;
    /* Fallback background */
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Neural Background */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #000000 100%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header Section */
header {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    /* For absolute positioning of toggle button */
}

.profile-img {
    width: 150px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.header-content {
    flex: 1;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header-content h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.contact-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section Styles */
section {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #ffffff;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Experience & Education */
.timeline-item {
    margin-bottom: 2rem;
    border-left: 2px solid var(--primary-color);
    padding-left: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}

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

.timeline-date {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.timeline-subtitle {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.responsibility-list {
    margin-top: 0.5rem;
    margin-left: 1rem;
    list-style-type: disc;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.responsibility-list li {
    margin-bottom: 0.25rem;
}

.skill-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e2e8f0;
}

/* Tech Stack Tags */
.tech-stack {
    margin-top: 0;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tech-category h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    text-align: center;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.tags span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tags span:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    color: #fff;
}

.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    perspective: 1000px;
    /* Essential for 3D effect context */
}

/* Project Card */
.project-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    height: 100%;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    /* Key for 3D internal elements */
    will-change: transform;
    /* Performance optimization */
}

.project-card:hover {
    /* Transform handled by JS for tilt, this is fallback/base */
    box-shadow: 0 10px 40px -10px rgba(0, 243, 255, 0.2);
    border-color: var(--primary-color);
    z-index: 10;
}

.project-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-desc {
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* Badges */
.badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-item img {
    width: 24px;
    height: 24px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .contact-info {
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }
}

/* Light Mode Styles */
body.light-mode {
    background: #f8fafc;
    color: #1e293b;
}

body.light-mode .section-title {
    color: #1e293b;
    border-bottom: 2px solid var(--accent-color);
}

body.light-mode section,
body.light-mode header,
body.light-mode .project-card,
body.light-mode .contact-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.light-mode .header-content h1 {
    color: #0f172a;
    text-shadow: none;
}

body.light-mode .contact-info,
body.light-mode .timeline-date {
    color: #475569;
}

body.light-mode .timeline-subtitle {
    color: #4b5563;
}

body.light-mode .tech-category h4 {
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
}

body.light-mode .tags span {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

body.light-mode .project-desc {
    color: #4b5563;
}

body.light-mode .badge-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

body.light-mode .aurora,
body.light-mode .stars,
body.light-mode .twinkling,
body.light-mode .falling-stars {
    display: none;
}

/* Theme Toggle Button */
.theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: absolute;
    top: 1rem;
    right: 1rem;
    margin: 0;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

body.light-mode .theme-btn {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #f59e0b;
    /* Sun color */
}

body.light-mode .theme-btn:hover {
    background: #cbd5e1;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .theme-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin: 0;
    }
}

/* UNIVERSAL LAYOUT FIXES */
html,
body {
    overflow-x: hidden;
    width: 100%;
}

.container {
    overflow-x: hidden;
    width: 100%;
}

* {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* HACKER TERMINAL */
#terminal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 300px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #10b981;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
}

#terminal-container.minimized {
    height: 40px;
    width: 200px;
    cursor: pointer;
}

#terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    cursor: pointer;
    user-select: none;
}

#terminal-title {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

#terminal-title::before {
    content: '>_';
    color: #10b981;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.t-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.t-min {
    background: #f59e0b;
}

.t-close {
    background: #ef4444;
}

#terminal-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

#terminal-output {
    margin-bottom: 8px;
}

.output-line {
    margin-bottom: 4px;
    line-height: 1.4;
    word-wrap: break-word;
}

.cmd {
    color: #fff;
    font-weight: bold;
}

.prompt-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #3b82f6;
    margin-right: 8px;
    white-space: nowrap;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #10b981;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
    caret-color: #10b981;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #terminal-container {
        width: 100%;
        bottom: 0;
        right: 0;
        border-radius: 8px 8px 0 0;
    }

    #terminal-container.minimized {
        width: 100%;
    }
}