/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6f42c1;
    --dark-color: #f8f9fa;
    --darker-color: #e9ecef;
    --light-color: #212529;
    --gray-color: #dee2e6;
    --text-color: #212529;
    --bg-color: var(--dark-color);
    --card-bg: var(--gray-color);
    --shadow: 0 0 1rem rgba(13, 110, 253, 0.4);
}

[data-theme="dark"] {
    --primary-color: #0ef;
    --secondary-color: #7b2cbf;
    --dark-color: #1f242d;
    --darker-color: #171c24;
    --light-color: #fff;
    --gray-color: #323946;
    --text-color: #fff;
    --bg-color: var(--dark-color);
    --card-bg: var(--gray-color);
    --shadow: 0 0 1rem rgba(0, 238, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-top: 120px; /* Increased for taller header */
}

section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.show-animate {
    opacity: 1;
    transform: translateY(0);
}

section:nth-child(even) {
    background-color: var(--darker-color);
}

.heading {
    text-align: center;
    font-size: 4.5rem;
    margin-bottom: 5rem;
}

.heading span {
    color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.8rem;
    background-color: var(--primary-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--primary-color);
    font-size: 1.6rem;
    color: var(--dark-color);
    font-weight: 600;
    letter-spacing: 0.1rem;
    transition: 0.5s ease;
    margin: 1rem 0;
}

.btn:hover {
    box-shadow: none;
    transform: translateY(-3px);
}

.btn i {
    margin-left: 0.5rem;
    font-size: 1.4rem;
}

/* ===== FIXED HEADER STYLES - STACKED LAYOUT ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px; /* Taller header for stacked layout */
    padding: 1rem 9%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Top row: Logo + Theme toggle + Hamburger */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 50px;
}

.logo {
    font-size: 2.2rem;
    color: var(--text-color);
    font-weight: 600;
    cursor: default;
    display: flex;
    align-items: center;
    height: 50px;
}

.logo span {
    color: var(--primary-color);
}

/* Theme toggle and hamburger container for mobile */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Theme Toggle */
#theme-toggle {
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    background: transparent;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: rgba(0, 238, 255, 0.1);
    transform: scale(1.1);
}

/* Hamburger menu for mobile */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.hamburger .line {
    width: 100%;
    height: 0.3rem;
    background-color: var(--text-color);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

/* Bottom row: Navigation links */
.nav-container {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
    height: 50px;
}

.nav-links a {
    font-size: 1.6rem;
    color: var(--text-color);
    font-weight: 500;
    transition: 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 50px;
    line-height: 50px;
    padding: 0 1rem;
    white-space: nowrap;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    height: 0.2rem;
    background-color: var(--primary-color);
    border-radius: 0.3rem;
}

/* ===== HERO SECTION WITH FIXED CIRCLE ALIGNMENT ===== */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10rem;
    min-height: calc(100vh - 120px);
}

.hero-content h4 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-top: 2rem;
}

.hero-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 1rem 0;
}

.hero-content h1 span {
    color: var(--primary-color);
}

.hero-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.hero-content h3 span {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.6rem;
    margin-bottom: 3rem;
    max-width: 60rem;
}

.social-links {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid var(--primary-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary-color);
    transition: 0.5s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    box-shadow: var(--shadow);
    transform: translateY(-0.5rem);
}

.hire-me {
    display: inline-flex;
    padding: 1.2rem 3.2rem;
}

/* FIXED CIRCLE ANIMATION SECTION - CROSS-BROWSER COMPATIBLE */
.hero-image {
    position: relative;
    width: 35vw;
    min-width: 300px;
    max-width: 400px;
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2.4rem);
    }
    100% {
        transform: translateY(0);
    }
}

/* Main container for the circular image */
.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ensure nothing goes outside the circle */
}

/* Animated background circle */
.image-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 4rem); /* Slightly larger than container */
    height: calc(100% + 4rem); /* Slightly larger than container */
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0deg,
        transparent 120deg,
        var(--primary-color) 240deg,
        transparent 360deg
    );
    animation: spin 8s linear infinite;
    opacity: 0.3;
    z-index: -1;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Profile image */
.profile-img {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 0.3rem solid var(--primary-color);
    box-shadow: var(--shadow);
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Outer spinning ring - FIXED FOR MAC/WINDOWS COMPATIBILITY */
.circle-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 0.3rem solid transparent;
    border-top-color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    box-sizing: border-box;
    animation: circleSpin 8s linear infinite;
}

@keyframes circleSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== ABOUT SECTION - PHOTO ON LEFT, CONTENT ON RIGHT FOR ALL DEVICES ===== */
.about {
    background-color: var(--darker-color);
}

.about-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align items at the top */
    gap: 8rem;
    width: 100%;
}

/* Photo on LEFT side (always left) */
.about-img {
    flex: 1;
    display: flex;
    justify-content: flex-start; /* Align image to the left */
    align-items: flex-start;
}

.about-img .image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-width: 250px;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-img img {
    width: 100%;
    height: auto;
    transition: 0.5s ease;
    display: block;
}

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

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.image-overlay span {
    background: var(--primary-color);
    color: var(--dark-color);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Content on RIGHT side (always right) */
.about-content {
    flex: 1;
    max-width: 60rem;
}

.about-content h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
}

.about-content h3 span {
    color: var(--primary-color);
}

.tagline {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.about-content p {
    font-size: 1.6rem;
    margin-bottom: 3rem;
}

.key-strengths {
    margin: 3rem 0;
}

.key-strengths h4 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.strengths-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.strength-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 238, 255, 0.1);
    border-radius: 1rem;
    transition: transform 0.3s ease;
}

.strength-item:hover {
    transform: translateY(-5px);
    background: rgba(0, 238, 255, 0.2);
}

.strength-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.strength-item span {
    font-size: 1.4rem;
    font-weight: 500;
}

/* ===== PERSONAL INFO SECTION - FIXED ALIGNMENT LIKE THE IMAGE ===== */
.personal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 3rem 0;
}

.info-card {
    display: flex;
    align-items: flex-start; /* Changed from center to flex-start for better alignment */
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 1rem;
    transition: transform 0.3s ease;
    width: 100%;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.info-card i {
    font-size: 2rem;
    color: var(--primary-color);
    width: 3rem;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.info-card div {
    display: flex;
    flex-direction: column;
    width: 100%; /* Ensure full width */
}

/* FIX: HEADINGS ALIGNMENT - Like the business card image */
.info-card span {
    font-size: 1.4rem; /* Increased from 1.2rem for better readability */
    color: var(--primary-color);
    opacity: 0.8;
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
    width: 100%;
    text-align: left;
}

.info-card strong {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    display: block;
    width: 100%;
    text-align: left;
    word-break: break-word; /* Prevent overflow */
}

.btn-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.download-cv {
    background-color: transparent;
    color: var(--primary-color);
    border: 0.2rem solid var(--primary-color);
    box-shadow: none;
}

.download-cv:hover {
    background-color: var(--primary-color);
    color: var(--dark-color);
    box-shadow: var(--shadow);
}

.contact-btn {
    background: #2ecc71;
    box-shadow: 0 0 1rem #2ecc71;
}

.projects-btn {
    background: #9b59b6;
    box-shadow: 0 0 1rem #9b59b6;
}

/* ===== TIMELINE STYLES ===== */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.timeline-btn {
    padding: 1.2rem 2.5rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    border-radius: 50px;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.timeline-btn.active {
    background: var(--primary-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.timeline {
    display: none;
    position: relative;
}

.timeline.active {
    display: block;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    border-radius: 3px;
}

.timeline-item {
    display: flex;
    margin-bottom: 5rem;
    position: relative;
}

.timeline-date {
    width: 150px;
    padding-right: 3rem;
    text-align: right;
    position: relative;
}

.timeline-date .year {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.timeline-date .status {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.timeline-date .status.upcoming {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.timeline-date .status.pursuing {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.timeline-date .status.completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.timeline-content {
    flex: 1;
    padding-left: 4rem;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 10px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
    z-index: 1;
}

.content-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h3 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.institution {
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 500;
}

.specialization, .role {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specialization i, .role i {
    color: var(--primary-color);
}

.highlight-points {
    margin: 1.5rem 0;
}

.highlight {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.highlight i {
    color: var(--primary-color);
}

.tech-stack, .skills-gained {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.tech-tag, .skill-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(0, 238, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.tech-tag:hover, .skill-tag:hover {
    background: var(--primary-color);
    color: var(--dark-color);
    transform: translateY(-2px);
}

.responsibilities {
    margin: 1.5rem 0;
}

.responsibilities h4 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.responsibilities ul {
    list-style: none;
    padding-left: 2rem;
}

.responsibilities li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.responsibilities li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.achievements {
    margin-top: 1.5rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    color: var(--primary-color);
}

/* ===== SKILLS SECTION ===== */
.skills {
    background-color: var(--darker-color);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}

.skill-category {
    flex: 1 1 40rem;
    background-color: var(--card-bg);
    padding: 3rem 2rem 4rem;
    border-radius: 2rem;
    text-align: center;
    border: 0.2rem solid var(--bg-color);
    transition: 0.5s ease;
}

.skill-category:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.skill-category h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.skill-box {
    margin-bottom: 2rem;
}

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

.skill-info span {
    font-size: 1.6rem;
}

.skill-info span:first-child {
    font-weight: 500;
}

.skill-bar {
    height: 1rem;
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    transition: width 1.5s ease;
}

.progress.excel { background: linear-gradient(90deg, #217346, #2ECC71); }
.progress.python { background: linear-gradient(90deg, #3776AB, #3498DB); }
.progress.sql { background: linear-gradient(90deg, #00758F, #1ABC9C); }
.progress.bi { background: linear-gradient(90deg, #F2C811, #F39C12); }
.progress.stats { background: linear-gradient(90deg, #8E44AD, #9B59B6); }
.progress.analytical { background: linear-gradient(90deg, #E74C3C, #E67E22); }
.progress.storytelling { background: linear-gradient(90deg, #3498DB, #2980B9); }
.progress.communication { background: linear-gradient(90deg, #2ECC71, #27AE60); }
.progress.collaboration { background: linear-gradient(90deg, #9B59b6, #8E44AD); }
.progress.critical { background: linear-gradient(90deg, #E67E22, #D35400); }

/* ===== PROJECTS SECTION ===== */
.projects {
    background-color: var(--bg-color);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    border: 0.2rem solid var(--bg-color);
    transition: 0.5s ease;
}

.project-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.03);
}

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

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

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

.project-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.1), var(--primary-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 4rem;
    transform: translateY(100%);
    transition: 0.5s ease;
}

.project-card:hover .project-layer {
    transform: translateY(0);
}

.project-layer h4 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-layer p {
    font-size: 1.6rem;
    margin-bottom: 2rem;
}

.project-links {
    display: flex;
    gap: 2rem;
}

.project-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background-color: var(--text-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--dark-color);
    transition: 0.5s ease;
}

.project-links a:hover {
    background-color: var(--dark-color);
    color: var(--text-color);
    transform: rotate(360deg);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.tech-used {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tech-used span {
    font-size: 1.4rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--dark-color);
    border-radius: 0.5rem;
}

/* ===== CONTACT SECTION ===== */
.contact {
    background-color: var(--darker-color);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}

.contact-info {
    flex: 1 1 40rem;
}

.contact-info h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-info p {
    font-size: 1.6rem;
    margin-bottom: 3rem;
}

.contact-info a {
    color: var(--primary-color);
    font-size: 1.6rem;
}

.contact-info .social-links {
    margin-top: 3rem;
}

.contact-form {
    flex: 1 1 40rem;
}

.input-box {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.input-box input {
    width: 49%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background-color: var(--card-bg);
    border-radius: 0.8rem;
    margin-bottom: 1rem;
}

.contact-form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background-color: var(--card-bg);
    border-radius: 0.8rem;
    resize: none;
    min-height: 20rem;
    margin-bottom: 2rem;
}

.contact-form button {
    cursor: pointer;
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--darker-color);
    padding: 2rem 9%;
    text-align: center;
}

.footer-content p {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.footer-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 5rem;
    height: 5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s ease;
}

.footer-top.active {
    opacity: 1;
    visibility: visible;
}

.footer-top a {
    font-size: 2.4rem;
    color: var(--dark-color);
}

/* ===== TYPING ANIMATION ===== */
.typed-text {
    color: var(--primary-color);
}

.cursor {
    display: inline-block;
    width: 0.3rem;
    background-color: var(--primary-color);
    margin-left: 0.2rem;
    animation: blink 1s infinite;
}

.cursor.typing {
    animation: none;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
    
    .nav-links {
        gap: 2rem;
    }
    
    .nav-links a {
        font-size: 1.5rem;
        padding: 0 0.3rem;
    }
    
    .hero-image {
        width: 40vw;
    }
    
    .about-container {
        gap: 6rem;
    }
}

@media (max-width: 991px) {
    header {
        padding: 1rem 3%;
    }
    
    section {
        padding: 10rem 3% 2rem;
    }
    
    footer {
        padding: 2rem 3%;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .hero-image {
        width: 45vw;
    }
    
    .about-container {
        gap: 5rem;
    }
    
    .about-img .image-container {
        max-width: 350px;
    }
}

/* ===== MOBILE RESPONSIVE FIXES - UPDATED FOR PERFECT ALIGNMENT LIKE THE IMAGE ===== */
@media (max-width: 768px) {
    body {
        padding-top: 100px; /* Adjusted for mobile header */
    }
    
    header {
        height: 100px;
        padding: 0.5rem 3%;
    }
    
    .header-top {
        height: 40px;
    }
    
    .logo {
        font-size: 2rem;
        height: 40px;
    }
    
    .header-right {
        gap: 1rem;
    }
    
    #theme-toggle {
        font-size: 1.8rem;
        height: 35px;
        width: 35px;
    }
    
    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
    }
    
    /* Hide desktop navigation on mobile */
    .nav-container {
        position: fixed;
        top: 100px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 100px);
        background-color: var(--bg-color);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 2rem 3% 4rem;
        overflow-y: auto;
        z-index: 999;
        transition: 0.3s ease;
    }
    
    .nav-container.active {
        left: 0;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0;
        height: auto;
        width: 100%;
    }
    
    .nav-links a {
        height: auto;
        line-height: normal;
        padding: 1.5rem 0;
        font-size: 1.8rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-links a.active::after {
        display: none;
    }
    
    .nav-links a.active {
        color: var(--primary-color);
        font-weight: 600;
    }
    
    /* Theme toggle in mobile menu */
    .mobile-theme-toggle {
        margin-top: 2rem;
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* HERO SECTION - STACK ON MOBILE */
    .hero {
        flex-direction: column;
        gap: 5rem;
        text-align: center;
        min-height: calc(100vh - 100px);
        padding-top: 2rem;
        margin-top: 0;
    }
    
    .hero-content {
        order: 2;
        padding: 0 1rem;
        width: 100%;
    }
    
    .hero-content h4 {
        font-size: 2.5rem;
        margin-top: 0;
        margin-bottom: 1rem;
    }
    
    .hero-content h1 {
        font-size: 4rem;
        margin: 0.5rem 0;
    }
    
    .hero-content h3 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    /* HERO IMAGE FOR MOBILE */
    .hero-image {
        width: 70vw;
        min-width: 280px;
        max-width: 320px;
        margin: 0 auto;
        order: 1;
    }
    
    .image-wrapper::before {
        width: calc(100% + 3rem);
        height: calc(100% + 3rem);
    }
    
    .profile-img {
        width: 88%;
        height: 88%;
    }
    
    .circle-spin {
        border-width: 0.25rem;
    }
    
    .social-links {
        margin-bottom: 3rem;
        justify-content: center;
    }
    
    /* FIX: ABOUT SECTION - PERFECT ALIGNMENT FOR PERSONAL INFO LIKE THE IMAGE */
    .about-container {
        flex-direction: column; /* Stack vertically on mobile */
        gap: 4rem;
    }
    
    .about-img {
        justify-content: center;
        width: 100%;
    }
    
    .about-img .image-container {
        width: 80vw;
        max-width: 350px;
        min-width: unset;
        margin: 0 auto;
    }
    
    .about-content {
        width: 100%;
        text-align: center;
    }
    
    /* FIX: PERSONAL INFO GRID - SINGLE COLUMN FOR BETTER ALIGNMENT */
    .personal-info {
        grid-template-columns: 1fr !important; /* Force single column */
        gap: 1.2rem;
        margin: 2.5rem 0;
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* FIX: INFO CARD - BETTER ALIGNMENT LIKE THE BUSINESS CARD IMAGE */
    .info-card {
        flex-direction: row;
        align-items: flex-start;
        padding: 1.2rem;
        gap: 1.2rem;
        width: 100%;
        text-align: left;
    }
    
    .info-card i {
        font-size: 1.8rem;
        width: 2.5rem;
        margin-top: 0.2rem; /* Align icon with text */
    }
    
    .info-card div {
        flex: 1;
        text-align: left;
    }
    
    /* FIX: HEADING AND CONTENT ALIGNMENT - LIKE THE IMAGE */
    .info-card span {
        font-size: 1.4rem;
        font-weight: 500;
        color: var(--primary-color);
        opacity: 1;
        margin-bottom: 0.3rem;
        display: block;
        text-align: left;
        width: 100%;
    }
    
    .info-card strong {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--text-color);
        display: block;
        text-align: left;
        width: 100%;
        line-height: 1.4;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Adjust grid layouts for mobile */
    .strengths-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .btn-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* OTHER SECTIONS */
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-date {
        width: 100%;
        text-align: left;
        padding-left: 4rem;
        margin-bottom: 1rem;
    }
    
    .timeline-content {
        padding-left: 4rem;
    }
    
    .timeline-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-card {
        padding: 2rem;
    }
    
    .contact-container {
        flex-direction: column;
    }
}

/* Hamburger animation */
.hamburger.active .line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

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

@media (max-width: 768px) {
    .hamburger.active .line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    
    .hamburger.active .line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* Extra small devices */
@media (max-width: 450px) {
    html {
        font-size: 50%;
    }
    
    .input-box input {
        width: 100%;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    #theme-toggle {
        margin-left: 0.5rem;
        font-size: 1.6rem;
        height: 30px;
        width: 30px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .hero-content h3 {
        font-size: 2.2rem;
    }
    
    .hero-image {
        width: 80vw;
        min-width: 250px;
        max-width: 280px;
    }
    
    .image-wrapper::before {
        width: calc(100% + 2.5rem);
        height: calc(100% + 2.5rem);
    }
    
    .circle-spin {
        border-width: 0.2rem;
    }
    
    .about-img .image-container {
        width: 90vw;
        max-width: 300px;
    }
    
    /* FIX: PERSONAL INFO FOR EXTRA SMALL DEVICES */
    .personal-info {
        gap: 1rem;
        margin: 2rem 0;
    }
    
    .info-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .info-card i {
        font-size: 1.6rem;
        width: 2.2rem;
    }
    
    .info-card span {
        font-size: 1.3rem;
    }
    
    .info-card strong {
        font-size: 1.4rem;
    }
    
    .btn-container {
        flex-direction: column;
    }
}

/* Very small devices */
@media (max-width: 365px) {
    #theme-toggle {
        margin-left: 0.3rem;
        font-size: 1.5rem;
    }
    
    .hamburger {
        width: 25px;
        height: 18px;
    }
    
    .hamburger .line {
        height: 0.25rem;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content h3 {
        font-size: 2rem;
    }
    
    .hero-image {
        width: 85vw;
        min-width: 220px;
        max-width: 250px;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    .about-img .image-container {
        width: 95vw;
        max-width: 280px;
    }
    
    /* FIX: PERSONAL INFO FOR VERY SMALL DEVICES */
    .personal-info {
        gap: 0.8rem;
    }
    
    .info-card {
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .info-card i {
        font-size: 1.5rem;
        width: 2rem;
    }
    
    .info-card span {
        font-size: 1.2rem;
    }
    
    .info-card strong {
        font-size: 1.3rem;
    }
}

/* Additional fix for Safari/Mac browser compatibility */
@supports (-webkit-touch-callout: none) {
    /* Safari specific fixes */
    .image-wrapper::before {
        -webkit-transform: translate3d(-50%, -50%, 0);
        transform: translate3d(-50%, -50%, 0);
    }
    
    .circle-spin {
        -webkit-transform: translate3d(-50%, -50%, 0);
        transform: translate3d(-50%, -50%, 0);
    }
    
    @keyframes spin {
        0% {
            -webkit-transform: translate3d(-50%, -50%, 0) rotate(0deg);
            transform: translate3d(-50%, -50%, 0) rotate(0deg);
        }
        100% {
            -webkit-transform: translate3d(-50%, -50%, 0) rotate(360deg);
            transform: translate3d(-50%, -50%, 0) rotate(360deg);
        }
    }
    
    @keyframes circleSpin {
        0% {
            -webkit-transform: translate3d(-50%, -50%, 0) rotate(0deg);
            transform: translate3d(-50%, -50%, 0) rotate(0deg);
        }
        100% {
            -webkit-transform: translate3d(-50%, -50%, 0) rotate(360deg);
            transform: translate3d(-50%, -50%, 0) rotate(360deg);
        }
    }
    
    /* FIX: Safari flexbox alignment */
    .info-card {
        -webkit-align-items: flex-start;
        align-items: flex-start;
    }
    
    .info-card div {
        -webkit-flex: 1;
        flex: 1;
    }
}
