/* Base Styles and Variables */
:root {
    --bg-color: #0a0a0a;
    --bg-color-light: #171A21;
    --text-color: #a0a0a0;
    --text-color-bright: #ffffff;
    --accent-color: #7E57C2;
    --accent-secondary: #4B6EF5;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
    --nav-height: 80px;
    --vh: 1vh; /* Default fallback for --vh custom property */
}

html[data-theme='light'] {
    --bg-color: #f5f5f7;
    --bg-color-light: #ffffff;
    --text-color: #555555;
    --text-color-bright: #000000;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color-bright);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: linear-gradient(to bottom, rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.99)), 
                      url('../images/bg-pattern.png');
    background-attachment: fixed;
    transition: background-color 0.3s ease;
}

html[data-theme='light'] body {
    background-image: linear-gradient(to bottom, rgba(245, 245, 247, 0.9), rgba(245, 245, 247, 0.99)), 
                      url('../images/bg-pattern.png');
}

html {
    scroll-behavior: smooth;
}

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

ul {
    list-style: none;
}

section {
    padding: 100px 5%;
    min-height: 100vh; /* Fallback */
    min-height: calc(var(--vh, 1vh) * 100); /* Use custom vh property */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    will-change: opacity, transform;
    transition: opacity 0.5s ease;
}

.highlight {
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    padding: 0 50px;
    background-color: rgba(23, 26, 33, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
}

html[data-theme='light'] .navbar {
    background-color: rgba(255, 255, 255, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo a {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin-right: 30px;
}

.nav-links {
    margin: 0 auto 0 0;
}

.nav-links ul {
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    transition: var(--transition);
}

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

/* Theme Toggle */
.theme-toggle {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 60px;
    height: 26px;
    background-color: var(--bg-color-light);
    border-radius: 50px;
    margin-right: 20px;
    padding: 0 5px;
    cursor: pointer;
}

.theme-toggle i {
    color: var(--text-color);
    font-size: 14px;
    z-index: 1;
}

.toggle-ball {
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    border-radius: 50%;
    left: 2px;
    transform: translateX(0px);
    transition: var(--transition);
}

html[data-theme='light'] .toggle-ball {
    transform: translateX(34px);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px 0;
    background-color: var(--text-color-bright);
    transition: var(--transition);
}

html[data-theme='light'] .hamburger span {
    background-color: var(--text-color);
}

/* Hero/About Section */
.hero-section {
    padding-top: 150px;
    padding-bottom: 50px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(126, 87, 194, 0.1) 0%, rgba(10, 10, 10, 0) 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: fadeIn 1s ease-out;
}

.about-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 50px;
}

.about-info {
    flex: 1;
    min-width: 300px;
}

.name-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
    color: var(--text-color-bright);
    text-shadow: 0 0 20px rgba(126, 87, 194, 0.3);
}

.subtitle {
    font-size: 26px;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 30px;
}

.about-text p {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 18px;
}

.profile-container {
    width: 280px;
    height: 280px;
    position: relative;
    margin: 0;
}

.profile-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 25px rgba(126, 87, 194, 0.5);
}

.profile-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: -1;
    filter: blur(20px);
    opacity: 0.6;
    background: radial-gradient(circle, var(--accent-color) 0%, var(--accent-secondary) 100%);
    animation: pulse 3s infinite alternate;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    margin-top: 30px;
    width: 100%;
    max-width: 800px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.skill-item img {
    width: 40px;
    height: 40px;
    transition: var(--transition);
}

/* Special handling only for Unreal and DirectX icons */
html[data-theme='dark'] .skill-item img[src*="unreal.svg"],
html[data-theme='dark'] .skill-item img[src*="directx.svg"] {
    filter: brightness(0) invert(1);
}

.skill-item:hover img {
    transform: translateY(-5px);
    filter: drop-shadow(0 0 8px rgba(126, 87, 194, 0.5));
}

html[data-theme='dark'] .skill-item:hover img[src*="unreal.svg"],
html[data-theme='dark'] .skill-item:hover img[src*="directx.svg"] {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(126, 87, 194, 0.5));
}

.skill-name {
    font-size: 12px;
    color: var(--text-color);
    margin-top: 8px;
    text-align: center;
}

.skill-item:hover .skill-name {
    color: var(--accent-color);
}

/* Section Arrow */
.section-arrow {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
}

.section-arrow a {
    display: block;
    color: var(--accent-color);
    font-size: 24px;
    animation: bounce 2s infinite;
    transition: var(--transition);
}

.section-arrow a:hover {
    color: var(--accent-secondary);
    transform: translateY(5px);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Title */
.section-title {
    font-size: 36px;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    color: var(--text-color-bright);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
}

/* Experience Section */
.experience-section {
    padding-top: 120px;
    padding-bottom: 120px;
}

.experience-container {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    min-height: 400px;
}

.experience-tabs {
    display: flex;
    flex-direction: column;
    width: 250px;
    border-left: 2px solid var(--bg-color-light);
}

.tab-btn {
    padding: 18px 22px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 16px;
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--accent-color);
    background-color: rgba(126, 87, 194, 0.05);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), var(--accent-secondary));
}

.experience-content {
    flex: 1;
    padding: 0 40px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
    display: block;
}

.job-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-color-bright);
}

.company-name {
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
    font-size: 18px;
    margin-bottom: 12px;
}

.job-date {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 25px;
}

.experience-content ul li {
    color: var(--text-color);
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
    font-size: 17px;
}

.experience-content ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-color-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
    animation-delay: calc(0.1s * var(--i, 1));
    position: relative;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-color), var(--accent-secondary));
    transition: var(--transition);
}

.project-card:hover::before {
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -15px rgba(0, 0, 0, 0.7);
}

.project-image {
    overflow: hidden;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 70%, rgba(23, 26, 33, 0.8) 100%);
    pointer-events: none;
}

html[data-theme='light'] .project-image::after {
    background: linear-gradient(to bottom, transparent 70%, rgba(255, 255, 255, 0.8) 100%);
}

.project-image img {
    width: 100%;
    display: block;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    margin-bottom: 10px;
    font-size: 24px;
    color: var(--text-color-bright);
}

.project-info p {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 15px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.project-tech span {
    font-size: 12px;
    padding: 5px 10px;
    margin-right: 10px;
    margin-bottom: 10px;
    background-color: rgba(126, 87, 194, 0.1);
    color: var(--accent-color);
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* Project Modal */
.project-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.project-modal.show {
    display: block;
}

.modal-content {
    background-color: var(--bg-color-light);
    margin: 10vh auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

html[data-theme='light'] .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    font-size: 28px;
    color: var(--text-color-bright);
    margin: 0;
}

.close-modal {
    color: var(--text-color);
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-body {
    color: var(--text-color);
    line-height: 1.8;
}

.modal-body p {
    margin-bottom: 20px;
}

.modal-body h3 {
    color: var(--text-color-bright);
    margin: 25px 0 15px;
    font-size: 22px;
}

.modal-body img {
    width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.modal-body ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.modal-body ul li::before {
    content: '▹';
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0;
}

.tech-stack span {
    background-color: rgba(126, 87, 194, 0.1);
    color: var(--accent-color);
    padding: 5px 12px;
    margin: 0 10px 10px 0;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-mono);
}

.modal-body .links {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.modal-body .links a {
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.modal-body .links a i {
    margin-right: 6px;
}

.modal-body .links a:hover {
    opacity: 0.8;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding: 100px 5%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--bg-color);
    position: relative;
}

.contact-subtitle {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.location-info {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.location-link {
    display: flex;
    align-items: center;
    color: var(--text-color-bright);
    font-size: 18px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.location-link i {
    margin-right: 10px;
    color: var(--accent-color);
    font-size: 22px;
}

.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.contact-item {
    margin: 0 15px;
}

.contact-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 16px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-link i {
    font-size: 20px;
}

.contact-link:hover {
    transform: translateY(-3px);
    color: var(--accent-color);
}

.social-links {
    display: flex;
    justify-content: center;
    margin: 0;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 15px;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 18px;
    transition: var(--transition);
}

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

.contact-form {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--bg-color-light);
    border-radius: 10px;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-color);
    border: 1px solid rgba(126, 87, 194, 0.1);
    border-radius: 5px;
    color: var(--text-color-bright);
    font-family: var(--font-main);
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(126, 87, 194, 0.3);
}

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

.submit-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
    border: none;
    border-radius: 5px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(75, 110, 245, 0.4);
}

/* Form message styles */
.form-message {
    padding: 10px 15px;
    margin-top: 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    transition: opacity 0.5s ease;
}

.form-message.success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.form-message.info {
    background-color: rgba(75, 110, 245, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(75, 110, 245, 0.3);
}

.form-message.error {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.form-message.fade-out {
    opacity: 0;
}

/* Footer */
.footer {
    padding: 20px;
    text-align: center;
}

.footer p {
    color: var(--text-color);
    font-size: 14px;
}

/* Enhanced Media Queries for Better Responsiveness */

/* Large Screens */
@media screen and (max-width: 1200px) {
    .hero-content, 
    .experience-container, 
    .projects-grid,
    .contact-form {
        max-width: 90%;
    }
    
    section {
        padding: 80px 4%;
    }
}

/* Tablets and Medium Screens */
@media screen and (max-width: 960px) {
    .experience-container {
        flex-direction: column;
    }
    
    .experience-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 15px;
        margin-bottom: 20px;
        width: 100%;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
        margin-right: 10px;
        margin-bottom: 5px;
        flex-shrink: 0;
    }
    
    .tab-btn.active::before {
        width: 100%;
        bottom: -2px;
        left: 0;
    }
    
    .modal-content {
        width: 90%;
        max-width: 600px;
    }
    
    .about-container {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .profile-container {
        margin: 0 auto 40px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        justify-content: center;
        margin-top: 20px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .navbar {
        padding: 0 30px;
    }
}

/* Mobile Devices */
@media screen and (max-width: 768px) {
    section {
        padding: 70px 3%;
        min-height: auto;
    }
    
    .navbar {
        padding: 0 20px;
        height: 70px;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background-color: var(--bg-color-light);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 5;
        transform: translateY(-100vh);
        transition: transform 0.3s ease;
        padding: 20px;
        backdrop-filter: blur(10px);
    }
    
    html[data-theme='light'] .nav-links {
        background-color: rgba(255, 255, 255, 0.95);
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links ul {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links li {
        margin: 15px 0;
    }
    
    .nav-links a {
        font-size: 18px;
    }
    
    .hamburger {
        display: block;
        z-index: 10;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -7px);
    }
    
    .name-title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px;
    }
    
    .project-card {
        margin-bottom: 0;
        max-width: 100%;
        box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.2);
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 20px;
    }
    
    .project-info p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .profile-container {
        width: 200px;
        height: 200px;
    }
    
    .profile-circle {
        width: 180px;
        height: 180px;
    }
    
    .theme-toggle {
        margin-right: 10px;
    }
    
    .job-title {
        font-size: 20px;
    }
    
    .company-name {
        font-size: 16px;
    }
    
    .experience-content {
        padding: 15px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        justify-content: center;
        margin-top: 20px;
    }
    
    .form-message {
        left: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .about-text p {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .project-card {
        padding: 15px;
    }
    
    .modal-body img {
        height: auto;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .hero-section {
        padding-top: 100px;
        padding-bottom: 30px;
        justify-content: flex-start;
        height: auto;
        min-height: 100vh;
    }
    
    .about-container {
        flex-direction: column-reverse;
        text-align: center;
        justify-content: flex-start;
        gap: 20px;
    }
    
    .profile-container {
        width: 180px;
        height: 180px;
        margin: 0 auto 20px;
    }
    
    .profile-circle {
        width: 160px;
        height: 160px;
    }
    
    .name-title {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .about-text p {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .skills-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        justify-content: center;
        overflow-x: visible;
        padding-bottom: 10px;
        margin-top: 20px;
    }
    
    .contact-section {
        padding: 70px 3% 50px;
    }
    
    .contact-form {
        width: 100%;
        padding: 25px 20px;
        margin-top: 20px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
    }
    
    .contact-subtitle {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 12px;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 500px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .profile-container {
        width: 180px;
        height: 180px;
    }
    
    .profile-circle {
        width: 160px;
        height: 160px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .name-title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .project-tech span {
        font-size: 11px;
        padding: 4px 8px;
        margin-right: 5px;
        margin-bottom: 5px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        margin: 0 5px;
    }
    
    .hero-section {
        padding-top: 80px;
    }
    
    .contact-form {
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 400px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .profile-container {
        width: 150px;
        height: 150px;
    }
    
    .profile-circle {
        width: 140px;
        height: 140px;
    }
    
    .nav-logo a {
        font-size: 16px;
    }
    
    .project-info p {
        font-size: 14px;
    }
    
    .nav-links a {
        font-size: 16px;
    }
}

/* Fix for project cards on tablets */
@media screen and (min-width: 501px) and (max-width: 960px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Fix for section heights on mobile */
@media screen and (max-height: 700px) {
    section {
        min-height: auto;
        padding: 60px 3%;
    }
    
    .hero-section {
        padding-top: 100px;
        padding-bottom: 30px;
    }
}

/* Fix Mobile Navigation Height */
@media screen and (max-width: 768px) {
    :root {
        --nav-height: 70px;
    }
}

/* Fix for specific elements on larger phones */
@media screen and (min-width: 401px) and (max-width: 500px) {
    .nav-links ul {
        width: 100%;
        max-width: 300px;
    }
}

/* Fix for horizontal orientation on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .nav-links {
        padding: 10px;
        overflow-y: auto;
    }
    
    .nav-links ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 5px 10px;
    }
    
    section {
        padding: 50px 3%;
    }
    
    .about-container {
        flex-direction: row;
        align-items: center;
    }
    
    .profile-container {
        margin: 0;
        width: 120px;
        height: 120px;
    }
    
    .profile-circle {
        width: 110px;
        height: 110px;
    }
}

/* Additional CSS for better mobile experience */
.touch-device .project-card {
    cursor: pointer;
}

.touch-device .nav-links a::after {
    height: 3px; /* Thicker tap target for touch devices */
}

/* Fix for iOS safari bottom padding */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        height: auto;
        min-height: calc(100vh - 50px);
    }
    
    @media screen and (max-width: 768px) {
        .hero-section {
            min-height: calc(var(--vh, 1vh) * 100 - 70px);
        }
    }
}

/* Fix for project modals on mobile */
@media screen and (max-width: 768px) {
    .project-modal .modal-content {
        max-height: 90vh;
        max-height: calc(var(--vh, 1vh) * 90);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links {
        height: calc(100vh - var(--nav-height));
        height: calc((var(--vh, 1vh) * 100) - var(--nav-height));
    }
}

/* Additional CSS for better mobile experience */
@media screen and (max-height: 700px) and (min-width: 769px) {
    .hero-section {
        padding-top: 100px;
        padding-bottom: 30px;
    }
    
    .about-container {
        gap: 30px;
    }
    
    .profile-container {
        width: 220px;
        height: 220px;
    }
    
    .profile-circle {
        width: 200px;
        height: 200px;
    }
}

/* Fix scrolling issues on small screens */
@media screen and (max-height: 600px) {
    .hero-section {
        height: auto;
        padding-bottom: 50px;
    }
} 