:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f4f4f4;
    --white: #fff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Premium Button Variables */
    --btn-gradient: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    --btn-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    --btn-hover-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
    --btn-radius: 8px;
}

[data-theme="dark"] {
    --primary-color: #5dade2;
    --secondary-color: #ecf0f1;
    --text-color: #f4f4f4;
    --bg-color: #1a1a1a;
    --white: #2c2c2c;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    
    /* Premium Button Variables (Dark Mode) */
    --btn-gradient: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
    --btn-shadow: 0 4px 15px rgba(93, 173, 226, 0.3);
    --btn-hover-shadow: 0 8px 25px rgba(93, 173, 226, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header & Nav */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 10;
}

.logo-bracket {
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo:hover .logo-bracket {
    text-shadow: 0 0 12px rgba(52, 152, 219, 0.6);
    color: var(--primary-color);
    transform: scale(1.1);
}

[data-theme="dark"] .logo {
    color: var(--text-color);
}

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

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

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

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    min-height: 100vh; /* Changed from height to min-height for better mobile support */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 80px 1rem 2rem; /* Adjusted top padding */
    margin-top: 0; /* Removed margin-top */
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    text-align: left; /* Changed from center to left */
}

.hero h1 {
    font-size: 3.5rem; /* Increased size */
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.2;
}

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

.hero p {
    font-size: 1.5rem; /* Increased size */
    margin-bottom: 2rem;
    color: #555;
}

/* Terminal Component */
.hero-terminal {
    flex: 1;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.terminal-window {
    width: 100%;
    max-width: 600px;
    background-color: #282a36; /* Dracula Background */
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: 'Fira Code', 'Courier New', monospace;
    animation: float 6s ease-in-out infinite;
    border: 1px solid #44475a;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.terminal-header {
    background-color: #21222c; /* Darker header */
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #44475a;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    transition: opacity 0.2s;
}

.terminal-btn:hover {
    opacity: 0.8;
}

.terminal-btn.red { background-color: #ff5555; }
.terminal-btn.yellow { background-color: #f1fa8c; }
.terminal-btn.green { background-color: #50fa7b; }

.terminal-title {
    color: #6272a4;
    font-size: 0.85rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-title::before {
    content: '\f120'; /* FontAwesome terminal icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.terminal-body {
    padding: 24px;
    color: #f8f8f2; /* Dracula Foreground */
    font-size: 0.95rem;
    line-height: 1.6;
    height: 380px;
    overflow-y: auto;
    cursor: text;
    background-image: radial-gradient(#44475a 1px, transparent 1px);
    background-size: 20px 20px; /* Subtle grid pattern */
}

.terminal-body::-webkit-scrollbar {
    width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #282a36;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #44475a;
    border-radius: 5px;
    border: 2px solid #282a36;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #6272a4;
}

.terminal-line {
    margin-bottom: 6px;
    word-break: break-all;
}

.prompt {
    color: #50fa7b; /* Dracula Green */
    font-weight: 600;
    margin-right: 8px;
}

.cmd {
    color: #f1fa8c; /* Dracula Yellow */
}

.output {
    color: #f8f8f2;
}

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

.terminal-input {
    background: transparent;
    border: none;
    color: #f1fa8c; /* Dracula Yellow */
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    width: 100%;
    outline: none;
    margin-left: 0;
    caret-color: #bd93f9; /* Dracula Purple */
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
}

[data-theme="dark"] .hero p {
    color: #ccc;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-gradient);
    color: var(--white);
    /* Desktop sizing: 0.75rem (12px) vertical, 1.75rem (28px) horizontal */
    padding: 0.75rem 1.75rem; 
    border-radius: var(--btn-radius);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    /* Desktop optimization: min 120px width, 40px height */
    min-width: 7.5rem; /* 120px */
    min-height: 2.5rem; /* 40px */
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-hover-shadow);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-outline::before {
    background: var(--primary-color);
    z-index: -1;
    width: 0;
    transition: width 0.3s ease;
    opacity: 1;
}

.btn-outline:hover {
    color: var(--white);
    box-shadow: var(--btn-hover-shadow);
    transform: translateY(-2px);
    border-color: transparent;
}

.btn-outline:hover::before {
    width: 100%;
}

[data-theme="dark"] .btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .btn-outline:hover {
    color: var(--white);
    border-color: transparent;
}

/* Sections Common */
section {
    padding: 5rem 1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}

/* About Section */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.about-text {
    max-width: 700px;
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 1rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.skill-tag {
    background-color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
    color: var(--secondary-color);
}

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

.project-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.project-image {
    height: 200px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-img {
    color: #888;
    font-weight: 600;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.project-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.btn-small {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-small:hover {
    text-decoration: underline;
}

/* Contact Section */
.contact {
    background-color: var(--white);
}

.contact-text {
    text-align: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.contact-item {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

.form-buttons {
    display: flex;
    gap: 1.5rem; /* Increased spacing for PC as well */
    flex-wrap: wrap;
    margin-top: 1rem;
    width: 100%; /* Ensure container fills the form width */
}

.form-buttons .btn {
    flex: 1; /* Allow buttons to grow to fill the available space */
}

[data-theme="dark"] .btn-outline {
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        text-align: center;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    /* Mobile Buttons */
    .form-buttons {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        margin-top: 2rem;
    }

    .form-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 1.2rem;
        font-size: 1.1rem;
    }
}