:root {
    --primary-color: #295f8a;
    --secondary-color: #e3f2fd;
    --dark-color: #1a3c5a;
    --accent-color: #82caff;
    --body-bg: #f8faff;
    --surface-bg: #ffffff;
    --muted-bg: #f1f6fb;
    --card-bg: #ffffff;
    --text-color: #243241;
    --muted-text: #6c7785;
    --border-color: #e6edf4;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 15px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #82caff;
    --secondary-color: #16314a;
    --dark-color: #d8efff;
    --accent-color: #9ed7ff;
    --body-bg: #07111d;
    --surface-bg: #0d1b2a;
    --muted-bg: #0a1624;
    --card-bg: #102235;
    --text-color: #eef7ff;
    --muted-text: #aac0d2;
    --border-color: #1d3c57;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.28);
    --shadow-strong: 0 15px 35px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    overflow-x: hidden;
    padding-top: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
}

.section-surface {
    background-color: var(--surface-bg);
}

.section-muted {
    background-color: var(--muted-bg);
}

.footer-surface {
    background-color: var(--surface-bg);
}

.border-top-custom {
    border-color: var(--border-color) !important;
}

.text-secondary-custom,
.text-muted-custom {
    color: var(--muted-text) !important;
}

/* --- NAVBAR --- */
.navbar {
    background-color: transparent;
    transition: all 0.4s ease;
    padding: 20px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff !important;
    letter-spacing: 1px;
    transition: 0.3s;
    cursor: pointer;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 12px;
    position: relative;
    transition: 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

.navbar.scrolled {
    background-color: var(--surface-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.navbar.scrolled .navbar-brand {
    color: var(--primary-color) !important;
}

.navbar.scrolled .nav-link {
    color: var(--dark-color) !important;
}

.navbar.scrolled .nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-contact-btn {
    color: #295f8a !important;
}

.navbar.scrolled .nav-contact-btn {
    background-color: var(--primary-color);
    color: var(--surface-bg) !important;
    border-color: var(--primary-color);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar.scrolled .navbar-toggler {
    border-color: var(--border-color);
}

.navbar.scrolled .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28130, 202, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
}

.navbar.scrolled .theme-toggle {
    background: var(--secondary-color);
    border-color: var(--border-color);
    color: var(--primary-color);
}

/* --- HERO SECTION --- */
.hero-section {
    min-height: 660px;
    padding-top: 10rem;
    padding-bottom: 6rem;
    margin-top: -80px;
    background: radial-gradient(circle at 15% 20%, rgba(130, 202, 255, 0.18), transparent 34%), linear-gradient(135deg, #1a3c5a, #295f8a);
    color: #fff !important;
}

.hero-kicker {
    display: inline-flex;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-section h1,
.hero-section h2,
.hero-section p,
.hero-section .lead {
    color: #fff !important;
}

.hero-section h1 span {
    color: var(--accent-color);
}

.hero-section h2,
.hero-section .lead {
    opacity: 0.92;
}

.hero-primary-btn {
    color: #295f8a !important;
}

.hero-profile-img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.2);
}

/* --- TITLES --- */
.section-title {
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 30px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.centered-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* --- PROJECTS & CARDS --- */
.project-card {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
    transition: 0.3s;
    height: 100%;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.featured-project-card {
    border-color: rgba(130, 202, 255, 0.45);
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.tech-badge,
.skill-badge {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 3px;
    display: inline-block;
}

.tech-badge {
    border-radius: 6px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.project-points {
    color: var(--muted-text);
    padding-left: 18px;
    margin-bottom: 18px;
}

.project-points li {
    margin-bottom: 6px;
}

.btn-store {
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background: var(--surface-bg);
    font-size: 0.85rem;
    padding: 8px 15px;
    border-radius: 8px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.btn-store:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

.disabled-store-btn,
.disabled-store-btn:hover {
    cursor: not-allowed;
    opacity: 0.82;
    color: var(--muted-text);
    background: var(--muted-bg);
    border-color: var(--border-color);
}

.nav-pills .nav-link {
    color: var(--text-color) !important;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 12px 30px;
    margin: 0 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-pills .nav-link::after {
    display: none;
}

.nav-pills .nav-link:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
    color: var(--surface-bg) !important;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(41, 95, 138, 0.3);
}

.load-more-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s;
    margin-top: 20px;
}

.load-more-btn:hover {
    background: var(--primary-color);
    color: var(--surface-bg);
}

.hidden-project {
    display: none;
}

/* --- CERTIFICATES --- */
.cert-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-soft);
    transition: 0.3s;
    height: 100%;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.cert-status {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.cert-logo {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.accordion-item,
.accordion-button,
.accordion-body {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color) !important;
    box-shadow: inset 0 -1px 0 var(--border-color);
}

.cert-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: 0.2s;
}

.cert-list-item:hover {
    background-color: var(--muted-bg);
    padding-left: 20px;
}

.cert-list-item:last-child {
    border-bottom: none;
}

.cert-list-icon {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1rem;
    flex: 0 0 auto;
}

.cert-id {
    font-size: 0.75rem;
}

/* --- CONTACT --- */
#contact-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid var(--border-color);
}

#contact-wrapper.active {
    max-width: 1000px;
}

.contact-info-panel {
    width: 100%;
    padding: 50px 40px;
    background: var(--card-bg);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.5s ease;
}

#contact-wrapper.active .contact-info-panel {
    width: 40%;
    background-color: var(--muted-bg);
    border-right: 1px solid var(--border-color);
}

.contact-form-panel {
    width: 0;
    opacity: 0;
    padding: 0;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    transition: all 0.7s ease;
}

#contact-wrapper.active .contact-form-panel {
    width: 60%;
    opacity: 1;
    padding: 50px 40px;
}

.form-control-custom {
    background-color: var(--muted-bg);
    color: var(--text-color);
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    width: 100%;
    transition: 0.3s;
}

.form-control-custom::placeholder {
    color: var(--muted-text);
}

.form-control-custom:focus {
    background-color: var(--surface-bg);
    border-color: var(--primary-color);
    outline: none;
}

.honeypot {
    display: none !important;
}

.btn-main {
    background-color: var(--primary-color);
    color: var(--surface-bg);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: 0.3s;
}

.btn-main:hover {
    filter: brightness(0.9);
}

.btn-auto-width {
    width: auto;
    padding: 15px 40px;
}

.icon-box {
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 20px;
    flex: 0 0 auto;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.social-link {
    color: var(--muted-text);
    transition: 0.2s;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* --- TIMELINE & ANIMATION --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline {
    border-left: 2px solid var(--border-color);
    padding-left: 25px;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 5px;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--surface-bg);
    box-shadow: 0 0 0 2px var(--border-color);
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--surface-bg);
        padding: 20px;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: var(--shadow-strong);
        border: 1px solid var(--border-color);
    }

    .nav-link {
        color: var(--dark-color) !important;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .theme-toggle {
        color: var(--primary-color);
        background: var(--secondary-color);
        border-color: var(--border-color);
        margin-top: 10px;
    }

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

    .hero-section .lead {
        font-size: 1rem;
    }

    #contact-wrapper {
        max-width: 100% !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .contact-info-panel {
        width: 100% !important;
        padding: 40px 30px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
    }

    #contact-wrapper.active .contact-info-panel {
        width: 100% !important;
    }

    .contact-form-panel {
        width: 100% !important;
        padding: 0 !important;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.5s ease, opacity 0.5s ease !important;
        display: block !important;
    }

    #contact-wrapper.active .contact-form-panel {
        max-height: 820px;
        opacity: 1;
        padding: 40px 30px !important;
        border-top: 1px solid var(--border-color);
    }

    #show-form-btn {
        display: block !important;
        margin-top: 20px;
    }

    #contact-wrapper.active #show-form-btn {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding-top: 8.5rem;
        padding-bottom: 4rem;
        min-height: auto;
    }

    .hero-profile-img {
        width: 220px;
        height: 220px;
    }

    .nav-pills .nav-link {
        width: 100%;
        margin: 5px 0;
    }

    .nav-pills .nav-item {
        width: 100%;
    }
}
