/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Typewriter cursor */
@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Cursor styling */
.typewriter-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    animation-fill-mode: both;
}

/* Code blocks */
pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 100px; /* Ensure consistent height during typing */
    font-family: 'Fira Code', 'Courier New', monospace;
    transition: opacity 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

pre.code-loading {
    opacity: 0.8;
}

pre code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    display: block;
    white-space: pre-wrap; /* Changed from pre-line to pre-wrap */
    word-wrap: break-word; /* Ensure long words break */
    word-break: break-word; /* Break long words if needed */
    color: #d4d4d4;
    tab-size: 4;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    overflow: visible;
    position: relative;
    width: 100%;
}

/* Typewriter cursor effect */
.typewriter-cursor {
    display: inline-block;
    width: 0.5em;
    height: 1.2em;
    background: var(--accent);
    animation: blink 0.7s step-end infinite;
    vertical-align: text-top;
    position: relative;
    margin-left: 1px;
    opacity: 0.8;
}

/* Code syntax highlighting */
.code-keyword {
    color: #c586c0; /* Purple for keywords */
    font-weight: 500;
}

.code-string {
    color: #ce9178; /* Orange for strings */
}

.code-comment {
    color: #6a9955; /* Green for comments */
    font-style: italic;
    opacity: 0.8;
}

.code-operator {
    color: #d4d4d4; /* Light gray for operators */
}

/* Additional token types */
.code-number {
    color: #b5cea8; /* Light green for numbers */
}

.code-function {
    color: #dcdcaa; /* Light yellow for functions */
}

.code-parameter {
    color: #9cdcfe; /* Light blue for parameters */
}

.code-boolean {
    color: #569cd6; /* Blue for booleans */
    font-weight: 500;
}

/* Theme-specific adjustments only for background and text */
[data-theme="light"] pre {
    background: #1e1e1e; /* Dark background for code blocks */
    color: #d4d4d4; /* Light text for better contrast */
}

[data-theme="dark"] pre {
    background: #1e1e1e;
    color: #d4d4d4;
}

/* Base Styles */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #0a0a0a;
    --card-bg-rgb: 40, 40, 40; /* RGB values for card background */
    --accent-rgb: 255, 0, 0; /* RGB values for accent color */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --card-bg-rgb: 245, 245, 245;
    --text-primary: #1a1a1a;
    --text-secondary: #4d4d4d;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea {
    font-family: inherit;
    font-size: 1rem;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 5rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent);
    margin: 1rem auto 0;
}

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

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

.btn {
    transition: all 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
    animation: pulse 1.5s infinite;
}

.btn-secondary {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background-color: rgba(255, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Hero Section */
.hero h1 {
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #b3b3b3;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.hero-description {
    font-size: 1.2rem;
    color: #b3b3b3; /* Using direct color to match dark theme's --text-secondary */
    margin: 0 0 2.5rem 0;
    line-height: 1.7;
    padding-left: 0.25rem;
}

/* Ensure colors stay consistent in light theme */
[data-theme="light"] .hero-description {
    color: #b3b3b3;
}

[data-theme="light"] .hero-subtitle {
    color: #b3b3b3;
}

.hero .highlight {
    color: var(--accent);
    white-space: nowrap;
    position: relative;
    display: inline-block;
}

.hero .highlight::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.hero:hover .highlight::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nowrap {
    white-space: nowrap;
}

.nickname {
    font-size: 0.7em;
    color: #888; /* Consistent grey color */
    opacity: 0.8;
    font-weight: normal;
    vertical-align: middle;
    margin-left: 4px;
    transition: color 0.3s ease;
}

/* Style for Solicis link */
a[href*="solicis.fr"] {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a[href*="solicis.fr"]:hover {
    color: var(--accent-hover);
}

a[href*="solicis.fr"]::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

a[href*="solicis.fr"]:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Header and footer specific adjustments */
header .nickname,
footer .nickname {
    color: #888; /* Same grey as hero */
}

/* Hover effect for better interactivity */
.nickname:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .nickname {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Header & Navigation */
/* Eco Mode Link */
.nav-eco {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2ed573;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-eco i {
    font-size: 1rem;
}

.nav-eco:hover {
    color: #7bed9f;
}

/* Hide text on mobile */
@media (max-width: 768px) {
    .eco-label {
        display: none;
    }
    
    /* Ensure code blocks respect container width on mobile */
    pre {
        padding: 1rem;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

[data-theme="light"] header {
    background-color: rgba(255, 255, 255, 0.9);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 2rem;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease, background-color 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
}

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

/* Language Toggle */
#language-toggle {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#language-toggle:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#language-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#language-toggle::after {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

#language-toggle:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#language-toggle:active {
    transform: translateY(0);
}

/* Language dropdown */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 140px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 4px;
    backdrop-filter: blur(8px);
    background-color: rgba(var(--card-bg-rgb), 0.95);
}

.language-dropdown:hover .language-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-option.active::before {
    transform: scaleY(1);
}

.language-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.language-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.language-option:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    transform: translateX(2px);
}

.language-option:active {
    transform: translateX(0);
    transition-duration: 0.1s;
}

.language-option.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(var(--accent-rgb), 0.1);
}

.lang-code {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.lang-name {
    flex: 1;
    white-space: nowrap;
}

/* Theme Toggle */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

#theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    transform: scale(1.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(26, 26, 26, 0.8) 100%), url('../assets/hero-bg.png') no-repeat center center/cover;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

.hero-image {
    margin-top: 3rem;
    opacity: 0;
    animation: fadeIn 1s ease 0.9s forwards;
}

.code-snippet {
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    overflow-x: auto;
}

.code-snippet pre {
    margin: 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #f8f8f2;
}

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

.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

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

.profile-image {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateY(-5px);
}

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

.info-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.info-item p {
    margin: 0;
    font-weight: 600;
}

/* Skills Section */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.skill-category {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

@media (min-width: 1200px) {
    .skill-category {
        max-width: none;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .skill-category {
        flex: 0 1 calc(33.333% - 1rem);
    }
}

@media (max-width: 767px) {
    .skill-category {
        flex: 0 1 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

.skill-category {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    max-width: 90%;
}

.skill-tags span {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tags span:hover {
    background-color: var(--accent);
    color: white;
}

/* Passions Section */
.passions {
    background-color: var(--bg-secondary);
}

.passion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.passion-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.passion-card:hover {
    transform: translateY(-5px);
}

.passion-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.passion-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.passion-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Projects Section */
.project-card {
    display: flex;
    gap: 3rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-content {
    flex: 1;
    padding: 2.5rem;
}

.project-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-image {
    flex: 1;
    min-height: 300px;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.contact .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.contact h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-size: 2.5rem;
}

.contact-content {
    display: flex;
    justify-content: center;
}

.contact-info {
    width: 100%;
    text-align: center;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-info p {
    margin-bottom: 2.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-methods {
    max-width: 500px;
    margin: 0 auto;
}

.email-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.email-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.email-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 70px;
    height: 70px;
    line-height: 70px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 50%;
    text-align: center;
}

.email-content h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    text-align: center;
    overflow: hidden; /* Ensure button doesn't overflow rounded corners */
}

.email-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
    width: 100%;
    min-height: 50px;
    padding: 0.5rem 0 1rem 0;
    margin: 0;
    position: relative;
}

/* Show copy button and adjust layout when email is revealed */
.email-link.revealed + .copy-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Remove hint margin when revealed */
.email-link.revealed .email-hint.visible {
    margin: 0;
    max-height: 0;
    opacity: 0;
}

.email-hint {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin: 0.3rem 0 0 0;
    text-align: center;
    width: 100%;
    line-height: 1.3;
    position: relative;
    display: block;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.email-hint.visible {
    max-height: 1.5rem;
    opacity: 0.8;
    margin: 0.3rem 0 0 0;
}

.copy-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 44px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
    border-radius: 0 12px 12px 0;
    z-index: 3; /* Ensure button is above success message */
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
}

.copy-btn:active {
    background: rgba(0, 0, 0, 0.1);
    transform: none;
}

/* Copy success message */
.copy-success {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--success-color, #28a745);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.copy-success.show {
    opacity: 1;
    transform: translateY(-50%) translateX(-10px);
}

.email-text {
    position: relative;
    z-index: 1;
    padding: 0.3rem 3.5rem 0.3rem 1.5rem; /* Add right padding for copy button */
    margin: 0;
    display: block;
    min-height: 1.3em;
    line-height: 1.3;
    transition: var(--transition);
    font-size: 1.05rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Center text when email is revealed */
.email-link.revealed .email-text {
    padding-right: 3.5rem; /* Space for copy button */
    text-align: center;
}

/* Adjust padding when email is revealed */
.email-link.revealed {
    padding-bottom: 0.5rem;
}

.email-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent);
    transition: var(--transition);
}

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

.contact-form {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

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

/* Footer */
footer {
    background-color: var(--bg-primary);
    padding: 3rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Remove footer-nickname class as we're using .nickname consistently */

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.25rem;
    transition: var(--transition);
}

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

/* Footer Text */
footer p {
    color: var(--text-secondary);
    margin: 1rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

footer p:hover {
    opacity: 1;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        margin-top: 3rem;
    }
    
    .project-card {
        flex-direction: column;
    }
    
    .project-image {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .hero {
        padding-top: 110px; /* Increased from 80px to account for mobile header */
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background-color: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.25rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: 110px; /* Slightly less padding on very small screens */
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        color: black;
        font-size: 12pt;
    }
    
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    header, footer, #back-to-top, .hamburger, #theme-toggle, #language-toggle {
        display: none;
    }
    
    section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .btn {
        display: none;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
        color: #666;
    }
    
    @page {
        margin: 2cm;
    }
}
