/* Global Styles & Variables */
:root {
    --primary-color: #0055a4;
    --secondary-color: #2171c7;
    --accent-color: #8ecae6;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-text: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --white: #ffffff;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dark mode (data-theme) */
[data-theme="dark"] {
    --primary-color: #7ab4ff;
    --secondary-color: #9ac3ff;
    --accent-color: #163a5d;
    --background-color: #0f141a;
    --text-color: #e6eef6;
    --light-text: #aab8c2;
    --border-color: #1f2a36;
    --success-color: #4dd17c;
    --white: #131a22;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

section {
    padding: 80px 0;
}

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

.section-subtitle {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-size: 0.9rem;
    padding: 10px 25px;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-small {
    font-size: 0.85rem;
    padding: 8px 15px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    background-color: var(--background-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-small:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

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

.placeholder-img {
    background-color: var(--accent-color);
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    border-radius: 0;
}

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    z-index: 100;
}

#navbar {
    padding: 15px 0;
}

#navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

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

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

.btn-contact {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 8px 15px;
    border-radius: 5px;
}

.btn-contact:hover {
    background-color: var(--secondary-color);
}

.theme-toggle {
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1.1rem;
    margin-left: 10px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--background-color);
}

/* Ensure icon contrast in toggle */
[data-theme="dark"] .theme-toggle i {
    color: var(--text-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding-top: 100px;
    padding-bottom: 100px;
    background-color: var(--white);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    overflow-x: hidden;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--light-text);
    margin-bottom: 20px;
}

.hero-content p {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: var(--light-text);
}

.cta-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.profile-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 5px solid var(--accent-color);
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-placeholder i {
    font-size: 8rem;
    color: var(--white);
}

/* Projects Section */
.projects {
    background-color: var(--background-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 400px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

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

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

.project-img {
    height: 200px;
    overflow: hidden;
}

/* Terminal-style placeholder for project image */
.terminal-placeholder {
    height: 100%;
    background: #0d1117;
    color: #c9d1d9;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #161b22;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5f56;
}
.terminal-dot:nth-child(2) { background: #ffbd2e; }
.terminal-dot:nth-child(3) { background: #27c93f; }

.terminal-body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 10px 12px;
    overflow: hidden;
    white-space: pre-wrap;
}

/* In light theme keep terminal readable */
[data-theme="light"] .terminal-placeholder,
:root:not([data-theme="dark"]) .terminal-placeholder {
    background: #0d1117;
    color: #c9d1d9;
}

.project-content ul {
    margin: 10px 0 0 18px;
    color: var(--light-text);
}
.project-content ul li { margin-bottom: 6px; }

.project-content {
    padding: 20px;
}

.project-content h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.project-content p {
    color: var(--light-text);
    margin-bottom: 15px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-stack span {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 10px;
}

.view-more {
    text-align: center;
}

/* Skills Section */
.skills {
    background-color: var(--white);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category h3 {
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Chip-based skills */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-list--stacked {
    flex-direction: column;
}

.chip-list--stacked .chip {
    display: block;
    width: 100%;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.chip::after {
    content: attr(data-level);
    color: var(--primary-color);
    font-weight: 700;
    text-transform: capitalize;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.04);
    padding: 2px 8px;
    border-radius: 999px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.skill-name {
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Experience Section */
.experience {
    background-color: var(--background-color);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.timeline-date {
    width: 45%;
    position: absolute;
    left: 0;
    top: 0;
    text-align: right;
    padding-right: 30px;
}

.timeline-date span {
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-content {
    width: 45%;
    position: relative;
    left: 55%;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.timeline-content h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.timeline-content h4 {
    margin-bottom: 15px;
    color: var(--light-text);
    font-weight: 500;
}

.timeline-content p {
    margin-bottom: 15px;
}

.timeline-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.timeline-content ul li {
    margin-bottom: 5px;
    list-style-type: disc;
}

.tech-used {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-used span {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* About Section */
.about {
    background-color: var(--white);
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--light-text);
}

.personal-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.personal-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.stats-container {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.stat-item {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--light-text);
}

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

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
}

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

.contact-item h3 {
    margin-bottom: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

/* Focus styles accessibility */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.alert i {
    font-size: 1.1rem;
}

.alert-success {
    background: rgba(40, 167, 69, 0.08);
    color: var(--text-color);
    border-color: rgba(40, 167, 69, 0.3);
}

.alert-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

[data-theme="dark"] .alert-success {
    background: rgba(77, 209, 124, 0.12);
    border-color: rgba(77, 209, 124, 0.35);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--light-text);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 119, 182, 0.2);
}

/* Footer */
footer {
    background-color: var(--white);
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-content p {
    color: var(--light-text);
}

.footer-content i {
    color: #e25555;
}

/* Education Section */
.education {
    background-color: var(--background-color);
}

.education .timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.education .timeline-content h4 {
    color: var(--light-text);
    font-weight: 500;
    margin-bottom: 10px;
}

.education .timeline-content p {
    margin-bottom: 15px;
}

.education .timeline-date span {
    font-weight: 600;
    color: var(--secondary-color);
}

.education .timeline-dot {
    background-color: var(--secondary-color);
}

.education .timeline::before {
    background-color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .cta-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-dot {
        left: 30px;
    }

    .timeline-date {
        width: 100%;
        left: 80px;
        top: 0;
        text-align: left;
        padding-left: 0;
        padding-right: 0;
    }

    .timeline-content {
        width: calc(100% - 80px);
        left: 80px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        transition: var(--transition);
        box-shadow: var(--box-shadow);
        overflow-x: hidden;
    }

    .nav-links.active {
        left: 0;
    }

    .hamburger {
        display: block;
    }

    .theme-toggle {
        margin-left: 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

    .about-content, 
    .contact-content {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .profile-container {
        width: 200px;
        height: 200px;
    }

    .timeline-content {
        padding: 15px;
    }

    .btn {
        padding: 10px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
} 