/* ================= VARIABLES ================= */
:root {
    /* Premium Purple Theme - Light Mode */
    --bg: #f8f7ff;
    /* Very pale purple/white */
    --text: #2d2a3e;
    /* Dark slate/purple */
    --card: #ffffff;
    --primary: #7c3aed;
    /* Vivid Violet */
    --primary-hover: #6d28d9;
    --accent: #ddd6fe;
    /* Light violet for backgrounds */
    --shadow: rgba(124, 58, 237, 0.1);
    --border: #e5e7eb;
}

/* ================= DARK MODE (CSS ONLY) ================= */
/* Using :has() to target body when checkbox is checked */
body:has(#theme-toggle:checked) {
    --bg: #0f0c29;
    /* Deep dark purple/black */
    --text: #e2e8f0;
    --card: #1e1b4b;
    /* Deep indigo */
    --primary: #a78bfa;
    /* Light Violet */
    --primary-hover: #c4b5fd;
    --accent: #312e81;
    --shadow: rgba(0, 0, 0, 0.4);
    --border: #4c1d95;
}

/* Hide the checkbox */
#theme-toggle {
    display: none;
}

/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

/* ================= BODY ================= */
body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

/* ================= TOGGLE BUTTON ================= */
.theme-btn {
    position: fixed;
    top: 25px;
    right: 30px;
    background: var(--card);
    color: var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow);
    z-index: 1000;
    border: 2px solid var(--primary);
    user-select: none;
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* ================= NAV BAR ================= */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: var(--card);
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 900;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary);
    color: white;
}


/* ================= HEADER ================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, var(--primary), #4c1d95);
    color: white;
    flex-wrap: wrap;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.5);
    margin-bottom: 40px;
}

.header-text h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.header-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    /* Improve image rendering */
    image-rendering: -webkit-optimize-contrast;
    transform: translateZ(0);
    /* Hardware accel for sharpness */
}

/* ================= SECTIONS ================= */
.section {
    max-width: 1000px;
    margin: auto;
    padding: 0 30px 50px 30px;
}

.section h2 {
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--primary);
    margin-top: 8px;
    border-radius: 2px;
}

/* ================= CARDS ================= */
.card {
    background: var(--card);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px var(--shadow), 0 2px 4px -1px var(--shadow);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px var(--shadow), 0 4px 6px -2px var(--shadow);
    border-color: var(--primary);
}

.card h3 {
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.card p {
    color: var(--text);
    opacity: 0.85;
}

/* ================= PROJECTS GRID ================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px dashed var(--primary);
    opacity: 0.7;
}

.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px -1px var(--shadow);
    transition: transform 0.3s ease;
}

.project-img:hover {
    transform: scale(1.02);
}

.project-content {
    flex-grow: 1;
}

.project-links {
    margin-top: 20px;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--text);
    /* Black/Dark for Github */
    color: var(--bg);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.github-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* ================= CONTACT PAGE ================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.contact-card {
    text-align: center;
    padding: 40px 20px;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: 0.2s;
}

.social-circle:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* Form Styles */
.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--shadow);
}

/* FAQ Styles */
.faq-details {
    background: var(--card);
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    overflow: hidden;
}

.faq-details[open] {
    border-color: var(--primary);
}

.faq-summary {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    /* Hide default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
}

.faq-details[open] .faq-summary::after {
    content: '-';
}

.faq-content {
    padding: 0 20px 20px 20px;
    color: var(--text);
    opacity: 0.9;
    font-size: 0.95rem;
}

/* ================= SKILLS ================= */
.skills {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 12px;
}

.skills li {
    background: var(--accent);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 5px var(--shadow);
}

/* ================= LIST ================= */
.list {
    padding-left: 20px;
    list-style-type: none;
}

.list li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.list li::before {
    content: '▹';
    color: var(--primary);
    position: absolute;
    left: -15px;
    font-weight: bold;
}

/* ================= DOWNLOAD BUTTON ================= */
.download-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 14px 30px;
    background: var(--primary);
    color: white;
    /* Always white on button */
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--shadow);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* ================= FOOTER ================= */
.footer {
    background: var(--card);
    color: var(--text);
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    border-top: 1px solid var(--accent);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }

    .header-text {
        margin-bottom: 30px;
    }

    .theme-btn {
        top: 15px;
        right: 15px;
    }

    .nav-bar {
        padding: 15px;
        gap: 15px;
    }

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