:root {
    --bg-color: #0a0a0a;
    --glass-color: rgba(255, 255, 255, 0.08);
    --text-color: #f0f0f0;
    --accent-color: #ffffff;
    --border-radius: 16px;
    --blur-amount: 12px;
    --transition-speed: 0.3s;
    --z-background: -1;
    --z-default: 1;
    --z-content: 10;
    --z-popups: 500; /* Increased from 100 */
    --z-overlay: 1000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    overflow-x: hidden;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.glass {
    background: var(--glass-color);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed) ease;
}

.glass:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

header {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3); /* Changed to softer border */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
    filter: brightness(1.1);
    background-color: rgba(0, 0, 0, 0.3); /* Added to prevent white edges */
}

.profile-picture:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.5); /* Brighter border on hover */
}

.profile-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all var(--transition-speed) ease;
}

.pronouns {
    font-size: 1.1rem;
    opacity: 0.8;
}

.flags {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.flag {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.flag:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.main-content {
    position: relative;
    z-index: var(--z-content);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.section {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: static; /* Added for z-index context */
    z-index: auto; /* Ensure sections stay above background */
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-speed) ease;
}

.section:hover .section-title::after {
    width: 70px;
}

.about-text {
    line-height: 1.6;
    opacity: 0.9;
}

.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05); /* Added background */
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px) scale(1.05);
}

.social-icon {
    font-size: 1.8rem;
    transition: transform 0.2s ease;
    color: white;
}

.social-link:hover .social-icon {
    transform: scale(1.2);
}

.social-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Skill Popups */
.skill-icon-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
}

.separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

/* Devicon Styling */
.devicon {
    font-size: 3rem; /* Increased from 2.5rem */
    transition: all var(--transition-speed) ease;
    color: white;
    filter: brightness(1.2);
}

.skill:hover .devicon {
    transform: scale(1.2) rotate(10deg);
    filter: brightness(1.5);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1.5rem; /* Increased gap */
}

.skill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: var(--z-default);
    padding: 1rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    background: rgba(255, 255, 255, 0.05); /* Added background */
    border-radius: 12px;
}

.skill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.skill-name {
    font-size: 0.9rem;
    text-align: center;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    z-index: 3; /* Ensure cards stay above background */
}

.project-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.project-card:hover .project-title {
    color: var(--accent-color);
}

.project-description {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

.project-link {
    margin-top: auto;
    align-self: flex-start;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    z-index: 100;
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.music-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.music-btn:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

.music-info {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Blur Overlay */
.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    transition: backdrop-filter 0.3s ease;
}

.enter-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.enter-button:hover {
    transform: scale(1.1);
    background: #bb86fc;
}

@media (max-width: 768px) {
    .profile-container {
        padding: 1.5rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        padding: 0 1.5rem 1.5rem;
    }
    
    .social-links {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }

    .music-player {
        bottom: 1rem;
        right: 1rem;
        padding: 0.6rem 1rem;
    }

    .skill-popup {
        width: 160px;
        font-size: 0.8rem;
    }
}

/* Updated flag hover effects */
.flag-container {
    position: relative;
}