/* Global Styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --dark-color: #0e1133;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Light Theme (default) */
    --bg-color: #fff;
    --bg-secondary: #f9fafb;
    --text-color: #333;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --card-bg: #fff;
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #0e1133;
    --footer-text: #fff;
    --timeline-bg: #f9f9ff;
    --progress-bg: #e9ecef;
}

/* Dark Theme */
html[data-theme="dark"] {
    --bg-color: #121212;
    --bg-secondary: #1e1e1e;
    --text-color: #f8f9fa;
    --text-secondary: #adb5bd;
    --border-color: #2d2d2d;
    --card-bg: #1e1e1e;
    --header-bg: rgba(18, 18, 18, 0.95);
    --footer-bg: #121212;
    --footer-text: #f8f9fa;
    --timeline-bg: #1e1e1e;
    --progress-bg: #2d2d2d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

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

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    position: relative;
}

.underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 0 auto;
    border-radius: 2px;
}

section {
    padding: 100px 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(67, 97, 238, 0.3);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.primary-btn:hover::before {
    opacity: 1;
}

.secondary-btn {
    background-color: transparent;
    color: var(--dark-color);
    border: 2px solid var(--primary-color);
    position: relative;
    z-index: 1;
}

.secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    transition: transform 0.3s ease;
    transform: scaleX(0);
    transform-origin: right;
}

.secondary-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.secondary-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.small-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.logo span {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
    border-radius: 2px;
}

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

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

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding-top: 180px;
    padding-bottom: 100px;
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(76, 201, 240, 0.1));
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(76, 201, 240, 0.05));
    z-index: 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
    padding-right: 30px;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-color);
    line-height: 1.2;
}

.hero-text h1 span {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-text h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.hero-text h2 span {
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.hero-text h2 span::after {
    content: '|';
    position: absolute;
    right: -5px;
    color: var(--primary-color);
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.hero-btns {
    margin-bottom: 30px;
}

.hero-btns .btn {
    margin-right: 15px;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

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

.image-container {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 5px solid #fff;
    background-color: #fff;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 5rem;
    font-weight: 700;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.image-container:hover .profile-image {
    transform: scale(1.05);
    filter: brightness(1.05);
}

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

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

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

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

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

.personal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-title {
    font-weight: 600;
    color: var(--text-color);
}

.info-value {
    color: var(--text-secondary);
}

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

.skills-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.skill-category h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.skill-item {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(76, 201, 240, 0.1));
    color: var(--primary-color);
    transition: var(--transition);
}

.skill-item:hover .skill-icon {
    transform: scale(1.1);
    color: var(--accent-color);
}

.skill-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.skill-progress {
    width: 100%;
    height: 8px;
    background-color: var(--progress-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Education Section */
.education {
    background-color: var(--bg-color);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    z-index: 1;
}

.timeline-content {
    position: relative;
    width: calc(50% - 40px);
    padding: 30px;
    background-color: var(--timeline-bg);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.timeline-item:nth-child(odd) .timeline-content {
    left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    left: calc(50% + 40px);
}

.timeline-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.timeline-content h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    position: relative;
    z-index: 1;
}

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

.project-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

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

.project-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-img::after {
    opacity: 1;
}

.project-content {
    padding: 30px;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.project-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

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

.project-tech span {
    padding: 5px 15px;
    background-color: var(--bg-secondary);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: var(--transition);
}

.project-card:hover .project-tech span {
    background-color: var(--primary-color);
    color: white;
}

.project-links {
    display: flex;
    gap: 15px;
}

/* Contact Section */
.contact {
    background-color: var(--bg-color);
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.contact-info p {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateX(5px);
}

.contact-item .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(76, 201, 240, 0.1));
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
}

.contact-item:hover .icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.1);
}

.contact-item .text h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

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

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

.contact-form {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

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

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 30px 0;
}

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

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #fff;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
    .hero-content,
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 50px;
    }

    .hero-btns,
    .social-icons {
        justify-content: center;
    }

    .social-icons {
        margin: 0 auto;
    }

    .about-image {
        margin-bottom: 50px;
    }

    .personal-info {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .contact-info {
        margin-bottom: 30px;
    }
    
    .image-container {
        width: 300px;
        height: 300px;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: #fff;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 999;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .hamburger {
        display: block;
    }

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

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

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

    .timeline::before {
        left: 30px;
    }

    .timeline-dot {
        left: 30px;
    }

    .timeline-content {
        width: calc(100% - 80px);
        left: 80px !important;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .image-container {
        width: 250px;
        height: 250px;
    }
    
    .hero {
        padding-top: 150px;
    }
    
    .project-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .project-links a {
        width: 100%;
    }

    .profile-image {
        object-position: center top;
    }
}

@media screen and (max-width: 576px) {
    .section-header h2 {
        font-size: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-btns {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .hero-btns .btn {
        margin-right: 0;
        width: 80%;
    }
    
    section {
        padding: 70px 0;
    }
    
    .hero {
        padding-top: 120px;
    }
    
    .image-container {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .contact-item .icon {
        margin: 0 auto;
    }
    
    .contact-item .text {
        text-align: center;
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-text h2 {
        font-size: 1.3rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .about-text h3 {
        font-size: 1.6rem;
    }
    
    .navbar {
        padding: 15px 0;
    }
    
    .logo a {
        font-size: 1.5rem;
    }
    
    .project-tech {
        flex-wrap: wrap;
    }
    
    .project-tech span {
        margin-bottom: 5px;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
    }
    
    .timeline-content h4 {
        font-size: 1rem;
    }
    
    .form-group input, 
    .form-group textarea {
        padding: 12px;
    }
    
    .profile-image {
        object-position: center 20%;
    }
}

/* Specific fixes for Redmi and other Android devices */
@media screen and (max-width: 400px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .image-container {
        width: 180px;
        height: 180px;
        border-width: 3px;
    }
    
    .skill-item {
        padding: 20px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .hero-btns .btn {
        width: 100%;
        padding: 10px 20px;
    }
    
    .social-icons a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
}

/* Fix for very small devices and landscape orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 100px;
        padding-bottom: 50px;
    }
    
    .hero-content {
        flex-direction: row;
        align-items: center;
    }
    
    .image-container {
        width: 150px;
        height: 150px;
    }
    
    .nav-links.active {
        overflow-y: auto;
    }
    
    section {
        padding: 50px 0;
    }
}

/* Fix for touch targets on mobile */
@media (hover: none) {
    .nav-links a,
    .btn,
    .social-icons a,
    .project-links a {
        padding: 12px 25px;
    }
    
    .nav-links li {
        margin: 10px 0;
    }
    
    .nav-links a {
        display: inline-block;
        padding: 10px 15px;
    }
}

/* Mobile-specific enhancements */
.mobile-device .btn,
.mobile-device .nav-links a,
.mobile-device .social-icons a,
.mobile-device .project-links a {
    -webkit-tap-highlight-color: transparent;
}

.touch-active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Improve header transition for mobile */
header {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Improve form elements on mobile */
@media (max-width: 768px) {
    input, textarea, button, select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    .form-group input:focus,
    .form-group textarea:focus {
        box-shadow: 0 0 0 2px var(--primary-color);
    }
    
    /* Improve scrolling performance */
    .hero, .about, .skills, .education, .projects, .contact {
        -webkit-overflow-scrolling: touch;
        will-change: transform;
    }
    
    /* Fix for sticky hover states on mobile */
    .btn:hover, 
    .nav-links a:hover, 
    .social-icons a:hover,
    .project-links a:hover,
    .footer-links a:hover {
        transition: none;
    }
}

/* Fix for Redmi devices with notches */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: env(safe-area-inset-top);
    }
    
    .hero {
        padding-top: calc(150px + env(safe-area-inset-top));
    }
}

/* Optimize images for mobile */
@media (max-width: 768px) {
    .image-container {
        will-change: transform;
    }
    
    .project-img img {
        will-change: transform;
    }
}

/* Fix for Android Chrome address bar resizing */
html, body {
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white !important;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
}

.resume-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(67, 97, 238, 0.3);
}

.resume-btn::after {
    display: none;
}

@media screen and (max-width: 768px) {
    .resume-btn {
        margin-top: 15px;
    }
}

/* Improve touch targets for mobile navigation */
@media (max-width: 768px) {
    .nav-links li a {
        padding: 12px 20px;
        display: block;
    }
    
    .hamburger {
        padding: 10px;
    }
    
    .bar {
        width: 30px;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle button,
.theme-toggle-mobile button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle button:hover,
.theme-toggle-mobile button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .theme-toggle button:hover,
html[data-theme="dark"] .theme-toggle-mobile button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.theme-toggle button .fa-sun,
.theme-toggle-mobile button .fa-sun {
    position: absolute;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.theme-toggle button .fa-moon,
.theme-toggle-mobile button .fa-moon {
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition);
}

html[data-theme="dark"] .theme-toggle button .fa-sun,
html[data-theme="dark"] .theme-toggle-mobile button .fa-sun {
    opacity: 1;
    transform: translateY(0);
}

html[data-theme="dark"] .theme-toggle button .fa-moon,
html[data-theme="dark"] .theme-toggle-mobile button .fa-moon {
    opacity: 0;
    transform: translateY(-20px);
}

.theme-toggle-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .theme-toggle {
        display: none;
    }
    
    .theme-toggle-mobile {
        display: flex;
        margin-left: 15px;
    }
}

/* Dark mode adjustments for project images */
html[data-theme="dark"] .project-img::after {
    background: rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .project-card {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for project images */
@media screen and (max-width: 768px) {
    .project-img {
        height: 220px;
    }
}

@media screen and (max-width: 480px) {
    .project-img {
        height: 200px;
    }
}
