:root {
    --bg-color: #ffffff;
    --text-main: #0f172a;
    --text-sec: #475569;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: #e2e8f0;
    --row-hover: #f8fafc;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-sec: #cbd5e1; /* Brighter slate for better contrast */
    --border: #1e293b;
    --row-hover: #1e293b;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px; /* Increased for desktop navbar */
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

h2 { 
    font-size: 2rem; 
    margin-bottom: 1rem;
}

h3 { 
    font-size: 1.25rem; 
}

p {
    color: var(--text-sec);
    font-size: 1.1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem max(5%, calc((100vw - 1100px) / 2));
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg-color) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
    transition: background 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    font-weight: 600;
    color: var(--text-sec);
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-toggle-item {
    display: none !important; /* Hidden on desktop */
}

.toggle-text {
    display: none; /* Hidden on desktop */
}

/* Dropdown */
.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 220px;
    z-index: 100;
}
.dropdown-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.dropdown-item {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dropdown-item:hover {
    background: var(--row-hover);
    transform: translateX(5px);
}
.dropdown-item.whatsapp {
    background-color: #25D366;
    color: white;
}
.dropdown-item.whatsapp:hover {
    background-color: #1ebe57;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
}
.theme-toggle:hover {
    transform: scale(1.15);
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn.primary {
    background-color: var(--accent);
    color: white;
    margin-top: 2rem;
}
.btn.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn.contact {
    background: var(--text-main);
    color: var(--bg-color);
    padding: 0.85rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none;
}
.btn.contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: var(--accent);
    color: white;
}

/* Hero Layout */
.hero {
    padding: 2rem 0 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}


/* About Content */
.about-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.about-content h2:first-child {
    margin-top: 0;
}
.about-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}
.about-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 2rem;
}
.about-list li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-sec);
    display: flex;
    align-items: center;
}
.about-list li::before {
    content: "•";
    color: var(--accent);
    margin-right: 0.75rem;
    font-size: 1.5rem;
    line-height: 1;
}

/* Skills section & Stars */
.skills-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 450px;
}
.skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}
.stars {
    display: inline-flex;
    gap: 4px;
    color: #fbbf24; /* gold color for stars */
}
.star.empty {
    color: #cbd5e1;
    fill: transparent;
}
[data-theme="dark"] .star.empty {
    color: #475569; /* Make empty stars visible but dark */
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 5% 4rem;
}

.subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    line-height: 1.8;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4rem 0;
}

/* Skills List */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-desc {
    font-size: 0.95rem;
    color: var(--text-sec);
    margin-left: 1.5rem;
}

.skill-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.skill-name::before {
    content: "•";
    color: var(--accent);
    margin-right: 0.75rem;
    font-size: 1.5rem;
    line-height: 1;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star {
    color: #eab308; /* Gold color */
    transition: transform 0.2s ease;
}

.star.empty {
    color: var(--border);
}

.skill-row:hover .star {
    transform: scale(1.1);
}

/* Projects */
.section-desc {
    margin-bottom: 2rem;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-row {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.project-row:hover {
    background-color: var(--row-hover);
    border-color: var(--border);
    transform: translateX(5px);
}

.project-favicon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-right: 1.5rem;
    object-fit: contain;
    background: white; /* In case favicons are transparent and dark mode is on */
    padding: 4px;
}

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

.project-info h3 {
    margin-bottom: 0.25rem;
}

.project-info p {
    font-size: 0.95rem;
    margin: 0;
}

.project-arrow {
    font-size: 1.5rem;
    color: var(--text-sec);
    transition: transform 0.3s ease, color 0.3s ease;
}

.project-row:hover .project-arrow {
    transform: translate(3px, -3px);
    color: var(--accent);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-sec);
    border-top: 1px solid var(--border);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1002;
}

.hamburger .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger .bar:nth-child(1) { top: 0; }
.hamburger .bar:nth-child(2) { top: 11px; }
.hamburger .bar:nth-child(3) { top: 22px; }

.hamburger.active .bar:nth-child(1) {
    top: 11px;
    transform: rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    top: 11px;
    transform: rotate(-45deg);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Preference Row (Mobile Toggles) */
.preference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    width: 100%;
}

.preference-label {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background: color-mix(in srgb, var(--bg-color) 80%, var(--border));
    border-radius: 20px;
    padding: 4px;
    border: 1px solid var(--border);
}

.seg-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.2s ease;
}

.seg-btn.active {
    background: var(--accent);
    color: white;
}

/* Theme Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border: 1px solid var(--text-sec);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-main);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: white;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 5%;
        margin-bottom: 0.5rem;
    }
    
    .logo {
        text-align: left;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-actions {
        display: flex;
        width: auto;
        justify-content: flex-end;
        gap: 1.5rem;
        order: 2;
        margin-top: 0;
        padding-bottom: 0;
    }
    
    .desktop-toggles {
        display: none !important; /* Hide desktop toggles */
    }

    .mobile-toggle-item {
        display: flex !important;
        width: 100%;
        margin-top: 1rem;
        justify-content: center;
    }
    
    .mobile-toggle-item button {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .toggle-text {
        display: inline;
        font-size: 1.1rem;
        font-weight: 500;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        order: 3;
        margin-top: 1rem;
        background: var(--row-hover);
        padding: 0.5rem 0;
        border-radius: 12px;
        position: static;
        transform: none;
        z-index: 1001;
    }
    
    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid color-mix(in srgb, var(--text-main) 15%, transparent);
    }
    
    .nav-links > li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 1.5rem;
        width: 100%;
    }
    
    .nav-links.show {
        display: flex;
    }

    .container {
        padding: 1rem 5% 4rem;
    }

    .hero {
        padding: 1rem 0 2rem;
    }

    .divider {
        margin: 2rem 0;
    }

    .project-row {
        flex-direction: row;
        align-items: center;
        padding: 1rem;
        gap: 1rem;
    }
    
    .project-favicon {
        margin-right: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .project-info h3 {
        font-size: 1.1rem;
    }

    .project-arrow {
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .skill-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
