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

:root {
    --primary-orange: #FF7001;
    --orange-light: #FF9D4D;
    --orange-dark: #E55D00;
    --dark-bg: #1A1A1A;
    --dark-text: #333333;
    --light-text: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray: #CCCCCC;
    --gray-dark: #666666;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    
    /* Light mode variables (default) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --card-bg: #FFFFFF;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-scrolled: rgba(255, 255, 255, 0.98);
    --hero-bg: linear-gradient(135deg, #FFF8F0 0%, #FFFFFF 100%);
    --border-color: #CCCCCC;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1A1A1A;
    --bg-secondary: #2D2D2D;
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --card-bg: #2D2D2D;
    --header-bg: rgba(26, 26, 26, 0.95);
    --header-scrolled: rgba(26, 26, 26, 0.98);
    --hero-bg: linear-gradient(135deg, #2D2D2D 0%, #1A1A1A 100%);
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Show content once CSS is loaded (remove no-css class) */
html:not(.no-css) body {
    visibility: visible;
    animation: fadeInPage 0.3s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    color-scheme: light dark;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Use emoji fonts for emoji content */
.emoji {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Segoe UI Symbol', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-variant: normal;
    line-height: 1.2;
}

/* Prevent layout shift by setting font-display: swap and reducing CLS */
html {
    /* Prevent layout shift on fonts load */
    font-size: 16px;
}

/* Ensure animated elements are hidden initially to prevent FOUC and growing effect */
.animate-fade-in {
    opacity: 0;
    transform: translateY(30px);
    will-change: opacity, transform;
}

/* Prevent layout thrashing on skill bars */
.skill-progress {
    will-change: width;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: var(--header-scrolled);
    box-shadow: 0 2px 20px var(--shadow-color);
}

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

.brand-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-orange);
    text-decoration: none;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.brand-logo:hover {
    transform: scale(1.1);
}

.brand-logo-img {
    width: 55px;
    height: 55px;
    transition: transform 0.3s ease;
}

.brand-logo:hover .brand-logo-img {
    transform: scale(1.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-orange);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: width 0.3s ease;
}

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

.dark-mode-toggle {
    margin-left: 0;
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 112, 1, 0.3);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover::before {
    opacity: 1;
}

.theme-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--text-primary);
    stroke: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover .theme-icon svg {
    fill: white;
    stroke: white;
}

/* Sun icon (for dark mode) */
.theme-icon .sun-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.8) rotate(45deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
}

/* Moon icon (for light mode) */
.theme-icon .moon-icon {
    position: absolute;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
}

/* When in dark mode */
[data-theme="dark"] .theme-icon .sun-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

[data-theme="dark"] .theme-icon .moon-icon {
    opacity: 0;
    transform: scale(0.8) rotate(-45deg);
}

[data-theme="dark"] .theme-toggle {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
}

.language-selector {
    margin: 0;
    display: flex;
    align-items: center;
}

/* Custom dropdown styles */
.custom-dropdown {
    position: relative;
    width: 48px;
    height: 48px;
}

.dropdown-selected {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    user-select: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: normal;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Segoe UI Symbol', sans-serif;
    font-variant-emoji: emoji;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.dropdown-selected:hover {
    border-color: var(--primary-orange);
    box-shadow: 0 0 10px rgba(255, 112, 1, 0.2);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

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

.dropdown-option {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dropdown-option:hover {
    background: var(--bg-secondary);
}

.dropdown-option:first-child {
    border-radius: 0;
}

.dropdown-option:last-child {
    border-radius: 0 0 3px 3px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: var(--bg-secondary);
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--dark-text);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 50px;
    background: var(--hero-bg);
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-content {
    padding-left: 4rem;
    padding-right: 2rem;
}

.hero-image {
    padding-right: 4rem;
    padding-left: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-title .letter.visible {
    opacity: 1;
}

.highlight {
    color: var(--primary-orange);
    background: linear-gradient(135deg, var(--primary-orange), var(--orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-orange);
    color: var(--light-text);
}

.btn-primary:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 112, 1, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-secondary:hover {
    background: var(--primary-orange);
    color: var(--light-text);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 3D Coin Effect */
.coin-container {
    width: 350px;
    height: 350px;
    perspective: 1000px;
    cursor: pointer;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(255, 112, 1, 0.3);
    border: 4px solid var(--primary-orange);
}

.coin-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.coin-front {
    transform: rotateY(0deg);
}

.coin-back {
    transform: rotateY(180deg);
}

.coin.flipped {
    transform: rotateY(180deg);
}

/* Mouse tracking rotation will be applied via JavaScript */
.coin.mouse-rotate {
    transition: transform 0.1s ease-out;
}

.coin.flipped.mouse-rotate {
    transition: transform 0.1s ease-out;
}

/* Section Styles */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-orange);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}

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

.about-text a {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid var(--primary-orange);
}

.about-text a:hover {
    color: var(--orange-light);
    border-bottom-color: var(--orange-light);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Skills Section */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
}

.skill-percentage {
    color: var(--primary-orange);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--gray);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), var(--orange-light));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* Projects Section */
.projects-carousel-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 30px 0;
}

.projects-carousel {
    display: flex;
    width: max-content;
    padding: 10px 0;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 300px;
    margin: 0 1rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Draggable carousel styles */
.projects-carousel-wrapper {
    cursor: grab;
    user-select: none;
}

.projects-carousel-wrapper:active {
    cursor: grabbing;
}

.projects-carousel-wrapper.dragging {
    cursor: grabbing;
}

/* Drag feedback styles */
.projects-carousel.dragging {
    transition: none !important;
}

/* Drag indicators */
.drag-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.projects-carousel-wrapper:hover .drag-hint {
    opacity: 1;
}

.drag-hint.left {
    left: 20px;
}

.drag-hint.right {
    right: 20px;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .projects-carousel-wrapper {
        cursor: default;
    }
    
    .drag-hint {
        display: none;
    }
}

/* Enhanced touch support */
@media (pointer: coarse) {
    .projects-carousel-wrapper {
        touch-action: pan-y; /* Allow vertical scrolling, handle horizontal drag ourselves */
        -webkit-tap-highlight-color: transparent;
    }
    
    .project-card {
        /* Prevent text selection on mobile during drag */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Better drag feedback */
.projects-carousel-wrapper.dragging .project-card {
    cursor: grabbing;
    transition: transform 0.1s ease-out;
}

/* Smooth transitions for all transforms */
.projects-carousel {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Prevent text selection during drag */
.dragging * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-orange), var(--orange-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    overflow: hidden;
}

.project-icon {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 1rem;
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.project-tech span {
    background: var(--bg-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .project-tech span {
    background: #444444;
    color: #CCCCCC;
}

.project-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    text-align: center;
    margin-top: auto;
    display: block;
}

.project-link:hover {
    color: var(--orange-dark);
}


/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

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

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.contact-item strong {
    color: var(--text-primary);
}

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

.social-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-orange);
    background: transparent;
}

.social-link:hover {
    color: white;
    background: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 112, 1, 0.3);
}

.social-link-icon {
    color: var(--primary-orange);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-orange);
    background: transparent;
}

.social-link-icon:hover {
    color: white;
    background: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 112, 1, 0.3);
}

.social-link-icon i {
    font-size: 1.2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
}

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

/* Footer */
.footer {
    background: var(--header-bg);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem 0;
    backdrop-filter: blur(10px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-orange);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 112, 1, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: var(--orange-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 112, 1, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-orange);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-message {
    flex-grow: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Screen Reader Only - Visually Hidden but Accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles (Tab Navigation) */
a:focus,
button:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus,
.dropdown-selected:focus,
.dropdown-option:focus,
.theme-toggle:focus,
.social-link:focus,
.social-link-icon:focus,
.project-link:focus,
.nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-orange);
    border-radius: 4px;
}

/* Remove default focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
.dropdown-selected:focus:not(:focus-visible),
.dropdown-option:focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible),
.social-link:focus:not(:focus-visible),
.social-link-icon:focus:not(:focus-visible),
.project-link:focus:not(:focus-visible),
.nav-link:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Keep focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.dropdown-selected:focus-visible,
.dropdown-option:focus-visible,
.theme-toggle:focus-visible,
.social-link:focus-visible,
.social-link-icon:focus-visible,
.project-link:focus-visible,
.nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-orange);
    border-radius: 4px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-fade-in {
        opacity: 1;
        transform: none;
    }
    
    .coin {
        transition: none;
    }
    
    .hero-title .letter {
        opacity: 1;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-orange: #FF6600;
        --border-color: #000000;
    }
    
    .btn-primary {
        border: 2px solid #000000;
    }
    
    .btn-secondary {
        border-width: 3px;
    }
    
    .project-card,
    .skill-item {
        border: 2px solid var(--border-color);
    }
}

/* Toast Notification ARIA Live Region */
.toast-container[aria-live="polite"] {
    position: fixed;
}

/* Animations */
.animate-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.animate-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Project card animations */
.project-card.animate-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card.animate-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Medium screens (tablets) - 480px to 880px */
@media (max-width: 880px) and (min-width: 481px) {
    .hero {
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        place-items: center;
    }
    
    .hero-content {
        text-align: center;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero-image {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .coin-container {
        width: 280px;
        height: 280px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .hero {
        min-height: 100vh;
        padding: 100px 0 30px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
        place-items: center;
    }
    
    .hero-content {
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-image {
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        min-width: 150px;
    }
    
    .coin-container {
        width: 230px;
        height: 230px;
    }
    
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 100%;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        text-align: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 27px var(--shadow-color);
        padding: 0;
        z-index: 999;
        max-height: calc(100vh - 100%);
        overflow-y: auto;
        border-radius: 16px 0 0 16px;
        gap: 0;
        opacity: 0;
    }
    
    .nav-menu.active {
        right: 0;
        opacity: 1;
    }
    
    .nav-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-toggle {
        display: flex;
        margin-left: 0.5rem;
    }
    
    .nav-item {
        margin: 0;
        display: flex;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
    }
    
    .language-selector {
        margin: 0;
    }
    
    .dark-mode-toggle {
        margin: 0;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    /* Mobile emoji fix - ensure proper rendering */
    .dropdown-selected {
        font-size: 1.5rem;
        line-height: 1.5;
        font-weight: normal;
        -webkit-font-smoothing: antialiased;
    }
}

/* Responsive Design */
@media (min-width: 481px) and (max-width: 768px) {
    .hero {
        min-height: 100vh;
        padding: 110px 0 40px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
        place-items: center;
    }
    
    .hero-content {
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-image {
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        min-width: 150px;
    }
    
    .profile-picture {
        width: 200px;
        height: 200px;
    }
    
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 100%;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        text-align: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 27px var(--shadow-color);
        padding: 0;
        z-index: 999;
        max-height: calc(100vh - 100%);
        overflow-y: auto;
        border-radius: 16px 0 0 16px;
        gap: 0;
        opacity: 0;
    }
    
    .nav-menu.active {
        right: 0;
        opacity: 1;
    }
    
    .nav-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-toggle {
        display: flex;
        margin-left: 0.5rem;
    }
    
    .nav-item {
        margin: 0;
        display: flex;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
    }
    
    .language-selector {
        margin: 0;
    }
    
    .dark-mode-toggle {
        margin: 0;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

/* Responsive styles for viewports between 769px and 879px */
@media (min-width: 769px) and (max-width: 879px) {
    .hero {
        min-height: 100vh;
        padding: 110px 0 40px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        place-items: center;
    }
    
    .hero-content {
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-image {
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-title {
        font-size: 2.3rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .coin-container {
        width: 260px;
        height: 260px;
    }
    
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 100%;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        text-align: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 27px var(--shadow-color);
        padding: 0;
        z-index: 999;
        max-height: calc(100vh - 100%);
        overflow-y: auto;
        border-radius: 16px 0 0 16px;
        gap: 0;
        opacity: 0;
    }
    
    .nav-menu.active {
        right: 0;
        opacity: 1;
    }
    
    .nav-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-toggle {
        display: flex;
        margin-left: 0.5rem;
    }
    
    .nav-item {
        margin: 0;
        display: flex;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
    }
    
    .language-selector {
        margin: 0;
    }
    
    .dark-mode-toggle {
        margin: 0;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .coin-container {
        width: 230px;
        height: 230px;
    }
}

/* Responsive coin size for tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .coin-container {
        width: 280px;
        height: 280px;
    }
}

/* Responsive styles for 880px to 1060px range */
@media (min-width: 880px) and (max-width: 1060px) {
    .hero .container {
        gap: 1.5rem;
    }
    
    .hero-content {
        padding-left: 2rem;
        padding-right: 1rem;
    }
    
    .hero-image {
        padding-right: 2rem;
        padding-left: 1rem;
    }
    
    .coin-container {
        width: 300px;
        height: 300px;
    }
}
