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

:root {
    /* ChatGPT Color Scheme */
    --chatgpt-green: #10A37F;
    --chatgpt-green-hover: #0d8f6e;
    --chatgpt-green-light: #e6f7f4;
    --bg-primary: #f7f7f8;
    --bg-card: #ffffff;
    --text-primary: #353740;
    --text-secondary: #6e6e80;
    --border-color: #e5e5e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --chatgpt-green: #10A37F;
    --chatgpt-green-hover: #0d8f6e;
    --chatgpt-green-light: rgba(16, 163, 127, 0.15);
    --bg-primary: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-primary: #e5e5e5;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Smooth theme transition for theme-dependent properties */
body,
.portfolio-container,
.personal-info-card,
.content-card,
.tech-stack-card,
.summary-card,
.modal-content,
.btn,
.tech-tag,
.project-item,
.cert-item,
.experience-item {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Theme transition animation */
@keyframes themeTransition {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.95;
    }

    100% {
        opacity: 1;
    }
}

.theme-transitioning {
    animation: themeTransition 0.4s ease;
}

html {
    scroll-behavior: smooth;
    transition: background-color 0.4s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-wrap: break-word;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}


/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--chatgpt-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Dark Mode Toggle Button */


/* Main Container - Single Screen Layout */
.portfolio-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.25rem;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0.5rem 0.6rem;
    min-height: calc(100vh - 2rem);
    align-items: start;
    position: relative;
    z-index: 1;
    transition: opacity 0.4s ease;
}

/* Left Column */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    height: fit-content;
    padding-right: 0.25rem;
}

/* Profile Header */
.profile-header {
    position: relative;
    margin-bottom: 0.5rem;
    overflow: visible;
    border-radius: 0.9rem 0.9rem 0.5rem 0.5rem;
    box-shadow: var(--shadow);
}

.profile-banner {
    background: linear-gradient(135deg, #0f172a, #0c8f70);
    color: white;
    padding: 1.2rem 1.1rem 2rem;
    padding-right: 5rem;
    /* Space for toggle switch */
    padding-left: 8rem;
    /* Space for views counter */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
    position: relative;
    isolation: isolate;
    min-height: 60px;
    transition: background 0.4s ease;
}

[data-theme="dark"] .profile-banner {
    background: linear-gradient(135deg, #1a1a1a, #0c8f70);
}

.role-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-style: italic;
    transition: color 0.4s ease;
}

.profile-banner .fa-lightbulb {
    font-size: 1rem;
    opacity: 0.85;
}

/* Views Counter - Inside Profile Banner */
.views-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    background: transparent;
    z-index: 10;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: white;
}

.views-counter:hover {
    transform: translateY(-1px);
}

.views-counter i {
    font-size: 0.9rem;
    color: #FFD700;
    opacity: 1;
    transition: transform 0.3s ease;
    display: inline-block;
}

.views-counter:hover i {
    animation: eyeMovement 1.5s ease-in-out infinite;
}

@keyframes eyeMovement {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    20% {
        transform: translate(3px, -2px) scale(1.15);
    }

    40% {
        transform: translate(-3px, 2px) scale(1.15);
    }

    60% {
        transform: translate(2px, 3px) scale(1.1);
    }

    80% {
        transform: translate(-2px, -3px) scale(1.1);
    }
}

.views-count {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 1.5rem;
    text-align: center;
}

.views-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: lowercase;
}

[data-theme="dark"] .views-counter {
    background: transparent;
}

[data-theme="dark"] .views-counter:hover {
    background: transparent;
}

/* Dark Mode Toggle Switch - Inside Profile Banner */
.dark-mode-toggle-switch {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 52px;
    height: 28px;
    cursor: pointer;
    z-index: 10;
}

.dark-mode-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    border: 2px solid transparent;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 2px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-icon {
    position: absolute;
    left: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    font-size: 12px;
}

.toggle-icon i {
    font-size: 12px;
    line-height: 1;
}

.toggle-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.toggle-icon-moon {
    opacity: 0;
    transform: translateX(0) scale(0.8);
}

.toggle-icon-sun {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.dark-mode-toggle-switch input:checked+.toggle-slider {
    background-color: #475569;
    border-color: transparent;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-moon {
    transform: translateX(24px) scale(1);
    color: #1e293b;
    opacity: 1;
    z-index: 2;
}

.dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-sun {
    transform: translateX(24px) scale(0.8);
    opacity: 0;
}

.dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-moon {
    opacity: 0;
    transform: translateX(0) scale(0.8);
}

.dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-sun {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.dark-mode-toggle-switch input:focus+.toggle-slider {
    border-color: var(--chatgpt-green);
}

.dark-mode-toggle-switch:hover .toggle-slider {
    border-color: var(--chatgpt-green);
}

.profile-picture {
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    z-index: 2;
}

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

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Override for fixed-size images that should maintain aspect ratio */
.project-image,
.modal-project-image,
.lightbox-image {
    max-width: 100%;
}

/* Personal Info Card */
.personal-info-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 3rem 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    flex: 1;
}

.profile-top-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.personal-info-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 163, 127, 0.12), transparent 38%);
    pointer-events: none;
}

.profile-content {
    text-align: center;
    margin-bottom: 1.1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
    transition: border-color 0.4s ease;
}

.name {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: color 0.4s ease;
}

.verified {
    color: var(--chatgpt-green);
    font-size: 1.1rem;
}

.location {
    color: var(--text-secondary);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: color 0.4s ease;
}

.location i {
    font-size: 0.875rem;
    color: #FF6B6B;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.icon-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-buttons-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-buttons-row .btn {
    flex: 1;
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .action-buttons-row .btn {
    border-color: rgba(255, 255, 255, 0.4);
}

.btn {
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    z-index: 3;
    overflow: hidden;
    cursor: pointer;
}

.btn-primary {
    background: var(--chatgpt-green);
    color: white;
    border-color: var(--chatgpt-green);
    box-shadow: 0 2px 4px rgba(16, 163, 127, 0.2);
}

.btn-primary:hover {
    background: var(--chatgpt-green-hover);
    border-color: var(--chatgpt-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 163, 127, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Match tech stack styling for icon-only buttons */
.icon-only.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .icon-only.btn-secondary {
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--chatgpt-green);
    color: var(--chatgpt-green);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Match tech stack hover styling for action buttons row */
.action-buttons-row .btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
}

[data-theme="dark"] .action-buttons-row .btn:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}

/* Match tech stack hover styling for icon-only buttons */
.icon-only.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .icon-only.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}


.btn-secondary:active {
    transform: translateY(0);
}

.btn i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.icon-only {
    width: 42px;
    height: 42px;
    padding: 0.55rem;
    justify-content: center;
}

/* Style image icons in icon-only buttons */
.icon-only img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Keep email and resume icons with default color */
.icon-only .fa-envelope,
.resume-btn .fa-file-alt {
    color: inherit;
}

.resume-btn {
    width: 100%;
    justify-content: center;
}

/* Cards */
.summary-card,
.tech-stack-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.content-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

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

.card-header i {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color 0.4s ease;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    transition: color 0.4s ease;
}

.badge {
    background: var(--chatgpt-green-light);
    color: var(--chatgpt-green);
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--chatgpt-green);
    margin-bottom: 0.25rem;
}

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

.availability {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.75rem;
}

/* Tech Stack */
.tech-filter {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.tech-tags {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.tech-category-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-category-heading {
    font-weight: 700;
    font-size: 0.65rem;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tech-tag {
    background: transparent;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.65rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease, color 0.4s ease, border-color 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tech-tag i {
    font-size: 0.7rem;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tech-tag .tech-icon-image {
    width: 0.7rem;
    height: 0.7rem;
    object-fit: contain;
    display: inline-block;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}


.tech-tag:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.tech-tag:hover i,
.tech-tag:hover .tech-icon-image {
    opacity: 1;
    transform: scale(1.1);
}

[data-theme="dark"] .tech-tag {
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .tech-tag:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive Tech Stack */
@media (max-width: 768px) {
    .tech-tag {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
        gap: 0.2rem;
    }

    .tech-tag i {
        font-size: 0.65rem;
    }

    .tech-tag .tech-icon-image {
        width: 0.65rem;
        height: 0.65rem;
    }

    .tech-category-heading {
        font-size: 0.6rem;
    }

    .tech-tags-container {
        gap: 0.3rem;
    }

    .tech-tags {
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .tech-tag {
        padding: 0.18rem 0.35rem;
        font-size: 0.55rem;
        gap: 0.18rem;
    }

    .tech-tag i {
        font-size: 0.6rem;
    }

    .tech-tag .tech-icon-image {
        width: 0.6rem;
        height: 0.6rem;
    }

    .tech-category-heading {
        font-size: 0.55rem;
    }

    .tech-tags-container {
        gap: 0.25rem;
    }

    .tech-tags {
        gap: 0.625rem;
    }
}

@media (max-width: 480px) {
    .tech-tag {
        padding: 0.15rem 0.3rem;
        font-size: 0.5rem;
        gap: 0.15rem;
    }

    .tech-tag i {
        font-size: 0.55rem;
    }

    .tech-tag .tech-icon-image {
        width: 0.55rem;
        height: 0.55rem;
    }

    .tech-category-heading {
        font-size: 0.5rem;
    }

    .tech-tags-container {
        gap: 0.2rem;
    }

    .tech-tags {
        gap: 0.5rem;
    }
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    align-items: start;
}

.two-column-grid .content-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.two-column-grid .projects-list,
.two-column-grid .certifications-list {
    flex: 1;
}

.right-column {
    align-self: start;
}

/* Main Content Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.25rem;
    align-items: stretch;
}

.main-content-grid>.content-card,
.main-content-grid>.experience-github-wrapper {
    height: 100%;
}

.left-content-column,
.right-content-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.left-content-column .content-card,
.right-content-column .content-card {
    display: flex;
    flex-direction: column;
}

/* Experience and GitHub Stats Side by Side */
.experience-github-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
    height: 100%;
}

.experience-github-wrapper>.content-card {
    height: 100%;
    margin-bottom: 0;
}

.github-stats-card-side {
    width: 100%;
    height: auto;
}

.experience-card-narrow {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.experience-card-narrow .experience-list,
.experience-card-narrow .experience-timeline {
    flex: 1;
    overflow: visible;
    min-height: 0;
}

/* Tech Stack + Experience Grid */
.experience-tech-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.25rem;
    align-items: stretch;
}

.experience-tech-grid .content-card,
.experience-tech-grid .tech-stack-card {
    display: flex;
    flex-direction: column;
}

/* About Text */
.about-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    transition: color 0.4s ease;
}

/* GitHub Stats */
.github-stats-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.github-stat-link {
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 100%;
}

.github-stat-link:hover {
    transform: translateY(-5px);
    opacity: 0.9;
}

.github-streak-img,
.github-languages-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Responsive GitHub Stats */
@media (max-width: 768px) {
    .github-stats-container {
        padding: 0.5rem 0;
        gap: 0.75rem;
    }

    .github-streak-img,
    .github-languages-img {
        border-radius: 6px;
    }

    /* Stack Experience and GitHub Stats on mobile */
    .experience-github-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Make experience card fit content on mobile */
    .experience-card-narrow {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .experience-card-narrow .experience-timeline {
        flex: none !important;
        overflow: visible !important;
    }
}

/* Zoom Responsive Adjustments */
@media (max-width: 1200px) {
    .experience-timeline {
        padding-left: clamp(1rem, 1.5rem, 1.8rem);
    }

    .timeline-item::before {
        left: clamp(-1.6rem, -1.3rem, -1rem);
    }

    .timeline-item:first-child::before {
        left: clamp(-1.7rem, -1.4rem, -1.1rem);
    }
}

@media (min-width: 1400px) {
    .timeline-role {
        font-size: clamp(0.85rem, 0.9rem, 1rem);
    }

    .timeline-company {
        font-size: clamp(0.7rem, 0.75rem, 0.85rem);
    }

    .timeline-year {
        font-size: clamp(0.75rem, 0.8rem, 0.9rem);
    }
}

/* Expertise Tags */
.expertise-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expertise-tag {
    padding: 0.5rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tag-blue {
    background: #E3F2FD;
    color: #1976D2;
}

[data-theme="dark"] .tag-blue {
    background: rgba(25, 118, 210, 0.2);
    color: #64B5F6;
}

.tag-green {
    background: #E8F5E9;
    color: #388E3C;
}

[data-theme="dark"] .tag-green {
    background: rgba(56, 142, 60, 0.2);
    color: #81C784;
}

.tag-pink {
    background: #FCE4EC;
    color: #C2185B;
}

[data-theme="dark"] .tag-pink {
    background: rgba(194, 24, 91, 0.2);
    color: #F48FB1;
}

.tag-orange {
    background: #FFF3E0;
    color: #F57C00;
}

[data-theme="dark"] .tag-orange {
    background: rgba(245, 124, 0, 0.2);
    color: #FFB74D;
}

/* Experience List */
/* Timeline Experience UI */
.experience-timeline {
    position: relative;
    padding-left: clamp(1.2rem, 1.8rem, 2.2rem);
    padding-top: clamp(0.3rem, 0.4rem, 0.5rem);
    padding-bottom: clamp(0.3rem, 0.4rem, 0.5rem);
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: clamp(0.3rem, 0.5rem, 0.7rem);
    top: 0;
    bottom: 0;
    width: clamp(1px, 2px, 3px);
    background: var(--border-color);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.35rem, 0.45rem, 0.6rem);
    margin-bottom: clamp(1.2rem, 1.6rem, 2rem);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: clamp(-1.8rem, -1.5rem, -1.2rem);
    top: clamp(0.15rem, 0.25rem, 0.35rem);
    width: clamp(10px, 12px, 14px);
    height: clamp(10px, 12px, 14px);
    border-radius: 50%;
    background: var(--text-secondary);
    border: clamp(1px, 2px, 3px) solid var(--card-bg);
    z-index: 1;
    opacity: 0.5;
}

.timeline-item:first-child::before {
    width: clamp(12px, 14px, 16px);
    height: clamp(12px, 14px, 16px);
    background: var(--chatgpt-green);
    opacity: 1;
    left: clamp(-1.9rem, -1.6rem, -1.3rem);
    top: clamp(0.1rem, 0.2rem, 0.3rem);
    border-color: var(--chatgpt-green);
    box-shadow: 0 0 0 clamp(2px, 3px, 4px) var(--chatgpt-green-light);
}

.timeline-year {
    display: inline-block;
    padding: clamp(0.2rem, 0.25rem, 0.3rem) clamp(0.6rem, 0.75rem, 0.9rem);
    border-radius: clamp(0.8rem, 1rem, 1.2rem);
    font-size: clamp(0.75rem, 0.85rem, 0.95rem);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--card-bg);
    border: clamp(0.5px, 1px, 1.5px) solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0;
    order: 2;
}

.timeline-item:first-child .timeline-year {
    background: var(--chatgpt-green-light);
    color: var(--chatgpt-green);
    border-color: var(--chatgpt-green);
    font-weight: 700;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(0.15rem, 0.2rem, 0.3rem);
}

.timeline-role {
    font-weight: 700;
    font-size: clamp(0.9rem, 1.05rem, 1.15rem);
    color: var(--text-primary);
    margin: 0;
    line-height: clamp(1.2, 1.3, 1.4);
    transition: color 0.4s ease;
}

.timeline-item:first-child .timeline-role {
    color: var(--chatgpt-green);
}

.timeline-company {
    font-size: clamp(0.75rem, 0.85rem, 0.95rem);
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.4s ease;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experience-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.exp-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.exp-role {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: color 0.4s ease;
}

.exp-company {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.4s ease;
}

.exp-bullets {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: color 0.4s ease;
}

.exp-bullets li {
    margin-bottom: 0.35rem;
}

.read-more {
    color: var(--chatgpt-green);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

.experience-item.is-hidden {
    display: none;
}

.see-all-btn {
    background: none;
    border: none;
    color: var(--chatgpt-green);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    margin-left: auto;
}

.see-all-btn:hover {
    background: var(--chatgpt-green-light);
    text-decoration: underline;
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    cursor: pointer;
    gap: 0.75rem;
}

.project-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

/* Project Image Slideshow */
.project-image-slideshow {
    position: relative;
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    outline: none;
}

.project-image-slideshow:focus {
    outline: 2px solid var(--chatgpt-green);
    outline-offset: 2px;
    border-radius: 0.5rem;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.slideshow-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    padding: 0.25rem;
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 2;
}

.slide-nav {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.6rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.slide-nav:hover {
    background: white;
    transform: scale(1.1);
}

.slide-nav i {
    font-size: 0.5rem;
}

.slide-dots {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot.active {
    background: white;
    width: 6px;
    height: 6px;
}

[data-theme="dark"] .dot {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .dot.active {
    background: var(--chatgpt-green);
}

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
}

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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-title {
    color: white;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.project-item:hover {
    background: var(--bg-primary);
}

.project-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: color 0.4s ease;
}

.project-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: color 0.4s ease;
}

.project-item i {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-link-btn,
.github-link-btn {
    background: var(--chatgpt-green-light);
    border: 1px solid var(--chatgpt-green);
    color: var(--chatgpt-green);
    border-radius: 0.375rem;
    width: auto;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.live-link-btn:hover,
.github-link-btn:hover {
    background: var(--chatgpt-green);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 163, 127, 0.3);
}

.live-link-btn:active,
.github-link-btn:active {
    transform: translateY(0);
}

/* Certifications List */
.certifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.cert-item:hover {
    background: var(--bg-primary);
}

.cert-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1;
}

.cert-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.4s ease;
}

.cert-info h4::after {
    display: none;
}

.cert-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    transition: color 0.4s ease;
}

.cert-item i {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.cert-image {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    margin-right: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100dvh;
    /* Dynamic viewport height for mobile browsers */
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
    /* Ensure modal overlays browser UI */
    padding: 0;
    margin: 0;
    /* Support for safe area insets (iOS notch, Android status bar) */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: max(env(safe-area-inset-top, 0), 0);
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 0;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    max-height: 85dvh;
    /* Dynamic viewport height for mobile */
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease;
    margin-top: max(env(safe-area-inset-top, 0), 1rem);
    margin-bottom: max(env(safe-area-inset-bottom, 0), 1rem);
    /* Ensure modal is always accessible */
    position: relative;
    z-index: 1001;
}

.resume-modal-content {
    max-width: 1000px;
    max-height: 95vh;
    max-height: 95dvh;
    /* Dynamic viewport height for mobile */
    height: 95vh;
    height: 95dvh;
    /* Dynamic viewport height for mobile */
    width: 90%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    margin-top: max(env(safe-area-inset-top, 0), 0.5rem);
    margin-bottom: max(env(safe-area-inset-bottom, 0), 0.5rem);
    position: relative;
    z-index: 1001;
}

.resume-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    padding-top: max(1.25rem, calc(1.25rem + env(safe-area-inset-top, 0)));
    border-bottom: 1px solid var(--border-color);
    /* Ensure close button is always accessible */
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    border-radius: 0.75rem 0.75rem 0 0;
}

.resume-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-download-resume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-download-resume:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.pdf-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.pdf-controls-left,
.pdf-controls-center,
.pdf-controls-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pdf-controls-center {
    flex: 1;
    justify-content: center;
}

.pdf-viewer-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pdf-control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.pdf-control-btn:hover {
    background: var(--bg-hover);
}

.pdf-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info,
.zoom-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0.5rem;
    min-width: 60px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    padding-top: max(1.5rem, calc(1.5rem + env(safe-area-inset-top, 0)));
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.4s ease;
    /* Ensure close button is always accessible */
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.4s ease;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease, color 0.4s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    /* Ensure body can scroll while header stays fixed */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-project-item,
.modal-cert-item,
.modal-experience-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    gap: 1rem;
}

.modal-project-item,
.modal-cert-item {
    cursor: pointer;
    align-items: center;
}

.modal-experience-item {
    flex-direction: column;
    cursor: default;
}

.modal-project-image {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.modal-cert-image {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-cert-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-project-item:hover,
.modal-cert-item:hover {
    background: var(--bg-primary);
    border-color: var(--chatgpt-green);
    transform: translateX(4px);
}

.modal-experience-item:hover {
    background: var(--bg-primary);
    border-color: var(--chatgpt-green);
}

.modal-project-item:last-child,
.modal-cert-item:last-child,
.modal-experience-item:last-child {
    margin-bottom: 0;
}

.modal-project-info {
    flex: 1;
}

.modal-cert-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1;
}

.modal-project-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-cert-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-cert-info h4::after {
    display: none;
}

.modal-project-info p,
.modal-cert-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.modal-project-item i,
.modal-cert-item i {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-project-item .project-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Modal Experience Item Styles */
.modal-experience-item .exp-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-experience-item .exp-role {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 1rem;
}

.modal-experience-item .exp-company {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.modal-experience-item .exp-bullets {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-experience-item .exp-bullets li {
    margin-bottom: 0.5rem;
}

.modal-project-item .live-link-btn,
.modal-project-item .github-link-btn {
    width: auto;
    min-width: 36px;
    height: 36px;
    font-size: 1rem;
    padding: 0 0.875rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Resume Modal Styles */
.resume-body {
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 100%;
    margin: 0;
    background: var(--bg-card);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    position: relative;
    /* Ensure resume body can scroll on mobile */
    -webkit-overflow-scrolling: touch;
}

.pdf-sidebar {
    display: none;
}

.pdf-thumbnails {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pdf-thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    padding: 0.125rem;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.pdf-thumbnail:hover {
    border-color: var(--border-color);
    background: var(--bg-hover);
}

.pdf-thumbnail.active {
    border-color: var(--chatgpt-green);
    background: var(--bg-hover);
}

.pdf-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.25rem;
}

.pdf-thumbnail-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.pdf-viewer-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    background: #525252;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: white;
    display: block;
    margin: 0 auto;
    /* High-quality rendering - let browser handle with devicePixelRatio scaling */
}

.resume-header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.resume-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.2;
}

.resume-contact {
    font-size: 0.875rem;
    color: var(--text-primary);
    text-align: left;
    line-height: 1.5;
}

.resume-contact a {
    color: var(--text-primary);
    text-decoration: underline;
}

.resume-contact a:hover {
    color: var(--chatgpt-green);
}

[data-theme="dark"] .resume-contact a {
    color: var(--text-primary);
}

[data-theme="dark"] .resume-contact a:hover {
    color: var(--chatgpt-green);
}

.resume-section {
    margin-bottom: 1.5rem;
}

.resume-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.resume-item {
    margin-bottom: 1.25rem;
}

.resume-item:last-child {
    margin-bottom: 0;
}

.resume-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resume-item-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    line-height: 1.3;
}

.resume-project-title,
.resume-cert-title {
    text-decoration: underline;
}

.resume-item-date {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    white-space: nowrap;
}

.resume-item-subtitle {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    margin-left: 0;
    line-height: 1.4;
    padding-left: 0;
}

.resume-item-description {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    margin-left: 0;
    padding-left: 0;
}

.resume-item-description strong {
    color: var(--text-primary);
    font-weight: 700;
}

.resume-bullets {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0 0;
}

.resume-bullets li {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.35rem;
    margin-left: 0.25rem;
    padding-left: 1rem;
    position: relative;
    margin-left: 0;
    text-indent: 0;
    padding-left: 1.25rem;
}

.resume-bullets li::before {
    content: "•";
    color: var(--text-primary);
    font-weight: normal;
    position: absolute;
    left: 0;
    font-size: 0.875rem;
}

[data-theme="dark"] .resume-bullets li::before {
    color: var(--chatgpt-green);
}

.resume-bullets li:last-child {
    margin-bottom: 0;
}

/* Contact Form Styles */
.contact-modal-content {
    max-width: 600px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all 0.2s ease, background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--chatgpt-green);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.form-actions .btn {
    min-width: 100px;
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

[data-theme="dark"] .form-message.success {
    background: rgba(56, 142, 60, 0.2);
    color: #81c784;
    border: 1px solid rgba(56, 142, 60, 0.4);
}

.form-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

[data-theme="dark"] .form-message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 0.5rem;
}

#submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .portfolio-container {
        grid-template-columns: 1fr;
        max-width: 900px;
        padding: 1rem;
    }

    .left-column {
        position: static;
        padding-right: 0;
    }

    .main-content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .experience-github-wrapper {
        grid-template-columns: 1fr 1fr;
        height: auto;
    }

    .personal-info-card {
        height: auto !important;
    }
}

@media (max-width: 968px) {
    .portfolio-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .left-column {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .main-content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .experience-tech-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        font-size: 0.85rem;
    }

    .card-header h3 {
        font-size: 0.95rem;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 768px) {
    .portfolio-container {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .experience-github-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }

    /* Ensure modals overlay browser UI on mobile */
    .modal {
        height: 100dvh;
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .modal.show {
        padding-top: env(safe-area-inset-top, 0);
        align-items: flex-start;
    }

    .modal-content,
    .resume-modal-content {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
        max-height: 100dvh;
        height: 100dvh;
    }

    .resume-modal-content {
        height: 100dvh;
        max-height: 100dvh;
    }

    .modal-header,
    .resume-modal-header {
        padding-top: max(1rem, calc(1rem + env(safe-area-inset-top, 0)));
        border-radius: 0;
        position: sticky;
        top: 0;
    }

    .profile-banner {
        padding: 1rem 0.875rem 2.5rem;
    }

    .role-title {
        font-size: 0.875rem;
    }

    .profile-picture {
        width: 80px;
        height: 80px;
        bottom: -40px;
    }

    .personal-info-card {
        padding: 2.5rem 0.875rem 1rem;
    }

    .name {
        font-size: 1.15rem;
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .location {
        font-size: 0.875rem;
    }

    .icon-buttons {
        gap: 0.375rem;
    }

    .icon-only {
        width: 38px;
        height: 38px;
        padding: 0.5rem;
    }

    .btn {
        font-size: 0.8125rem;
        padding: 0.6rem 0.875rem;
    }

    .resume-btn {
        font-size: 0.8125rem;
    }

    .content-card,
    .tech-stack-card {
        padding: 1rem;
    }

    .card-header {
        margin-bottom: 0.875rem;
        gap: 0.5rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    .about-text {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .tech-tags {
        gap: 1rem;
    }

    .tech-category-section {
        gap: 0.625rem;
    }

    .tech-category-heading {
        font-size: 0.7rem;
    }

    .tech-tags-container {
        gap: 0.5rem;
    }

    .tech-tag {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }

    .tech-filter {
        font-size: 0.8rem;
        padding: 0.3rem 0.625rem;
    }

    .project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.875rem;
    }

    .project-image,
    .project-image-slideshow {
        width: 100%;
        height: 180px;
        max-width: none;
    }

    .project-info {
        width: 100%;
    }

    .project-info h4 {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }

    .project-info p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .project-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .live-link-btn,
    .github-link-btn {
        width: auto;
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
        padding: 0 0.875rem;
    }

    .cert-item {
        padding: 0.875rem;
    }

    .cert-image {
        width: 50px;
        height: 38px;
        margin-right: 0.625rem;
        cursor: pointer;
    }

    .cert-info h4 {
        font-size: 0.9rem;
    }

    .cert-info p {
        font-size: 0.8rem;
    }

    .experience-item {
        padding: 0.5rem 0;
    }

    .exp-role {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .exp-company {
        font-size: 0.85rem;
    }

    .exp-bullets {
        font-size: 0.85rem;
        padding-left: 1rem;
        line-height: 1.5;
    }

    .exp-bullets li {
        margin-bottom: 0.5rem;
    }

    .read-more,
    .see-all-btn {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5rem;
    }

    .modal-content {
        width: 95%;
        max-height: 92vh;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .contact-form {
        gap: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.625rem;
        font-size: 0.875rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    .modal-project-item,
    .modal-cert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .modal-cert-image {
        width: 100%;
        height: auto;
        max-height: 150px;
        object-fit: contain;
        cursor: pointer;
    }

    .modal-project-image {
        width: 100%;
        height: 200px;
        max-width: none;
    }

    .modal-project-info,
    .modal-cert-info {
        width: 100%;
    }

    .modal-project-info h4,
    .modal-cert-info h4 {
        font-size: 0.95rem;
    }

    .modal-project-info p,
    .modal-cert-info p {
        font-size: 0.85rem;
    }

    .modal-project-item .project-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .lightbox-content {
        max-width: 95%;
        padding: 1rem;
    }

    .lightbox-image {
        max-height: 80vh;
    }

    .lightbox-title {
        font-size: 0.9rem;
        margin-top: 0.75rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 1.75rem;
        background: rgba(255, 255, 255, 0.25);
    }
}

@media (max-width: 640px) {
    .portfolio-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .profile-banner {
        padding: 0.875rem 0.75rem 2.25rem;
    }

    .role-title {
        font-size: 0.8125rem;
    }

    .profile-picture {
        width: 70px;
        height: 70px;
        bottom: -35px;
    }

    .personal-info-card {
        padding: 2.25rem 0.75rem 0.875rem;
    }

    .name {
        font-size: 1.1rem;
    }

    .verified {
        font-size: 1rem;
    }

    .location {
        font-size: 0.8125rem;
    }

    .icon-buttons {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .icon-only {
        width: 40px;
        height: 40px;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.55rem 0.75rem;
    }

    .resume-btn {
        width: 100%;
    }

    .content-card,
    .tech-stack-card {
        padding: 0.875rem;
        border-radius: 0.625rem;
    }

    .card-header {
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }

    .card-header i {
        font-size: 0.9rem;
    }

    .card-header h3 {
        font-size: 0.875rem;
    }

    .about-text {
        font-size: 0.8125rem;
    }

    .tech-tags {
        gap: 0.875rem;
    }

    .tech-category-section {
        gap: 0.5rem;
    }

    .tech-category-heading {
        font-size: 0.65rem;
    }

    .tech-tags-container {
        gap: 0.375rem;
    }

    .tech-tag {
        font-size: 0.65rem;
        padding: 0.3rem 0.65rem;
    }

    .tech-filter {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .project-item {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .project-image,
    .project-image-slideshow {
        height: 160px;
    }

    .project-info h4 {
        font-size: 0.875rem;
    }

    .project-info p {
        font-size: 0.75rem;
    }

    .live-link-btn,
    .github-link-btn {
        width: auto;
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
        padding: 0 0.625rem;
    }

    .cert-item {
        padding: 0.75rem;
    }

    .cert-image {
        width: 45px;
        height: 34px;
        margin-right: 0.5rem;
        cursor: pointer;
    }

    .cert-info {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .cert-info h4 {
        font-size: 0.875rem;
    }

    .cert-info h4::after {
        display: none;
    }

    .cert-info p {
        font-size: 0.75rem;
    }

    .experience-item {
        padding: 0.375rem 0;
    }

    .exp-role {
        font-size: 0.875rem;
    }

    .exp-company {
        font-size: 0.8125rem;
    }

    .exp-bullets {
        font-size: 0.8125rem;
        padding-left: 0.875rem;
    }

    .exp-bullets li {
        margin-bottom: 0.4rem;
    }

    .read-more,
    .see-all-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .modal-content {
        width: 98%;
        max-height: 95vh;
        border-radius: 0.625rem;
    }

    .resume-modal-content {
        max-width: 98%;
        max-height: 95vh;
        width: 95%;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .contact-form {
        gap: 0.875rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .form-group textarea {
        min-height: 100px;
    }

    .form-message {
        font-size: 0.8125rem;
        padding: 0.625rem;
    }

    .modal-project-item,
    .modal-cert-item {
        padding: 0.875rem;
        gap: 0.625rem;
    }

    .modal-cert-image {
        width: 100%;
        height: auto;
        max-height: 120px;
        object-fit: contain;
        cursor: pointer;
    }

    .modal-project-image {
        height: 180px;
    }

    .modal-project-info h4,
    .modal-cert-info h4 {
        font-size: 0.9rem;
    }

    .modal-project-info p,
    .modal-cert-info p {
        font-size: 0.8rem;
    }

    .modal-project-item .live-link-btn,
    .modal-project-item .github-link-btn {
        width: auto;
        min-width: 32px;
        height: 32px;
        font-size: 0.875rem;
        padding: 0 0.625rem;
    }

    .resume-body {
        padding: 0;
        font-size: 0.8rem;
        flex: 1;
        min-height: 0;
    }

    .pdf-controls-bar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    .pdf-controls-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .pdf-sidebar {
        width: 200px;
        min-width: 200px;
    }

    .pdf-viewer-container {
        padding: 0.5rem;
    }

    .resume-name {
        font-size: 1.35rem;
    }

    .resume-contact {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .resume-section {
        margin-bottom: 1.25rem;
    }

    .resume-section-title {
        font-size: 0.875rem;
        margin-bottom: 0.625rem;
    }

    .resume-item {
        margin-bottom: 1rem;
    }

    .resume-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }

    .resume-item-title {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .resume-item-date {
        font-size: 0.8rem;
        margin-top: 0;
    }

    .resume-item-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }

    .resume-item-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .resume-bullets {
        margin-top: 0.375rem;
    }

    .resume-bullets li {
        font-size: 0.8rem;
        line-height: 1.5;
        padding-left: 1rem;
        margin-bottom: 0.3rem;
    }

    .lightbox-content {
        max-width: 98%;
        padding: 0.75rem;
    }

    .lightbox-image {
        max-height: 75vh;
    }

    .lightbox-title {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.3);
    }

    .slideshow-controls {
        padding: 0.2rem;
    }

    .slide-nav {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }

    .slide-nav i {
        font-size: 0.45rem;
    }

    .dot {
        width: 3px;
        height: 3px;
    }

    .dot.active {
        width: 5px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    .portfolio-container {
        padding: 0.5rem;
    }

    /* Enhanced mobile modal styles for small screens */
    .modal-content,
    .resume-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .modal-header,
    .resume-modal-header {
        padding-top: max(0.875rem, calc(0.875rem + env(safe-area-inset-top, 0)));
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-close {
        /* Ensure close button is large enough and accessible */
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-banner {
        padding: 0.75rem 0.625rem 2rem;
    }

    .role-title {
        font-size: 0.75rem;
    }

    .profile-picture {
        width: 60px;
        height: 60px;
        bottom: -30px;
    }

    .personal-info-card {
        padding: 2rem 0.625rem 0.75rem;
    }

    .name {
        font-size: 1rem;
    }

    .location {
        font-size: 0.75rem;
    }

    .icon-only {
        width: 36px;
        height: 36px;
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }

    .content-card,
    .tech-stack-card {
        padding: 0.75rem;
    }

    .card-header h3 {
        font-size: 0.8125rem;
    }

    .about-text {
        font-size: 0.75rem;
    }

    .project-image,
    .project-image-slideshow {
        height: 140px;
    }

    .project-info h4 {
        font-size: 0.8125rem;
    }

    .project-info p {
        font-size: 0.7rem;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .resume-modal-content {
        max-width: 100%;
        max-height: 95vh;
        width: 100%;
    }

    .modal-header {
        padding: 0.875rem;
    }

    .resume-modal-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .resume-header-actions {
        gap: 0.5rem;
    }

    .btn-download-resume {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    .pdf-controls-bar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .pdf-controls-left,
    .pdf-controls-right {
        gap: 0.5rem;
    }

    .pdf-control-btn {
        padding: 0.375rem;
        font-size: 0.75rem;
    }

    .pdf-viewer-title {
        font-size: 0.75rem;
        display: none;
    }

    .page-info,
    .zoom-info {
        font-size: 0.75rem;
        min-width: 50px;
    }

    .resume-body {
        flex: 1;
        min-height: 0;
    }

    .pdf-sidebar {
        width: 150px;
        min-width: 150px;
    }

    .pdf-viewer-container {
        padding: 0.25rem;
    }

    .modal-body {
        padding: 0.875rem;
    }

    .resume-name {
        font-size: 1.2rem;
    }

    .resume-contact {
        font-size: 0.7rem;
    }

    .resume-section-title {
        font-size: 0.8125rem;
    }

    .resume-item-title {
        font-size: 0.8rem;
    }

    .resume-item-date,
    .resume-item-subtitle,
    .resume-item-description,
    .resume-bullets li {
        font-size: 0.75rem;
    }

    .contact-form {
        gap: 0.75rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.55rem;
        font-size: 0.8rem;
    }

    .form-group textarea {
        min-height: 90px;
    }

    .form-actions {
        margin-top: 0.25rem;
    }

    .form-message {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* Dark Mode Toggle Responsive */
@media (max-width: 768px) {
    .profile-banner {
        padding-right: 4.5rem;
        padding-left: 7rem;
        /* Space for views counter on mobile */
    }

    .views-counter {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .views-counter i {
        font-size: 0.8rem;
    }

    .views-count {
        font-size: 0.8rem;
        min-width: 1.2rem;
    }

    .views-label {
        font-size: 0.7rem;
    }

    .dark-mode-toggle-switch {
        top: 0.75rem;
        right: 0.75rem;
        width: 48px;
        height: 24px;
    }

    .dark-mode-toggle-switch .toggle-slider {
        border-radius: 24px !important;
        border: 2px solid transparent;
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
        width: 48px !important;
        height: 24px !important;
    }

    .dark-mode-toggle-switch:hover .toggle-slider {
        border-color: var(--chatgpt-green);
    }

    .dark-mode-toggle-switch .toggle-slider:before {
        height: 20px;
        width: 20px;
        left: 2px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .dark-mode-toggle-switch .toggle-icon {
        width: 20px;
        height: 20px;
        left: 2px;
        z-index: 2;
    }

    .dark-mode-toggle-switch .toggle-icon i {
        font-size: 11px;
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider:before {
        transform: translateX(22px);
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-moon {
        transform: translateX(22px) scale(1);
        color: #1e293b;
        opacity: 1;
        z-index: 2;
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-sun {
        transform: translateX(22px) scale(0.8);
        opacity: 0;
    }

    .dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-moon {
        opacity: 0;
        transform: translateX(0) scale(0.8);
    }

    .dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-sun {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@media (max-width: 480px) {
    .profile-banner {
        padding-right: 4rem;
        padding-left: 6.5rem;
        /* Space for views counter on small mobile */
    }

    .views-counter {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .views-counter i {
        font-size: 0.75rem;
    }

    .views-count {
        font-size: 0.75rem;
        min-width: 1rem;
    }

    .views-label {
        font-size: 0.65rem;
    }

    .dark-mode-toggle-switch {
        top: 0.5rem;
        right: 0.5rem;
        width: 44px;
        height: 22px;
    }

    .dark-mode-toggle-switch .toggle-slider {
        border-radius: 22px !important;
        border: 2px solid transparent;
        width: 44px !important;
        height: 22px !important;
    }

    .dark-mode-toggle-switch:hover .toggle-slider {
        border-color: var(--chatgpt-green);
    }

    .dark-mode-toggle-switch .toggle-slider:before {
        height: 18px;
        width: 18px;
        left: 2px;
    }

    .dark-mode-toggle-switch .toggle-icon {
        width: 18px;
        height: 18px;
        left: 2px;
        z-index: 2;
    }

    .dark-mode-toggle-switch .toggle-icon i {
        font-size: 10px;
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider:before {
        transform: translateX(20px);
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-moon {
        transform: translateX(20px) scale(1);
        color: #1e293b;
        opacity: 1;
        z-index: 2;
    }

    .dark-mode-toggle-switch input:checked+.toggle-slider .toggle-icon-sun {
        transform: translateX(20px) scale(0.8);
    }

    .dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-moon {
        transform: translateX(0) scale(0.8);
    }

    .dark-mode-toggle-switch input:not(:checked)+.toggle-slider .toggle-icon-sun {
        transform: translateX(0) scale(1);
    }
}

/* Touch-friendly targets for mobile */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .icon-only,
    .live-link-btn,
    .github-link-btn,
    .read-more,
    .see-all-btn,
    .modal-close,
    .lightbox-close,
    .slide-nav,
    .dark-mode-toggle-switch {
        min-width: 44px;
        min-height: 44px;
    }

    .project-item,
    .cert-item,
    .modal-project-item,
    .modal-cert-item {
        min-height: 60px;
    }
}

/* ============================================
   CHATBOT STYLES - Messenger Style
   ============================================ */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 60px;
    height: 60px;
    padding: 0 20px;
    border-radius: 30px;
    background: #000000;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    animation: bounceButton 2s infinite;
    white-space: nowrap;
}

.chatbot-toggle i {
    font-size: 24px;
    flex-shrink: 0;
    color: white;
}

.chatbot-toggle-text {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: white;
}

.chatbot-toggle:hover {
    transform: scale(1.05) translateY(0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: #1a1a1a;
    animation: none;
    /* Stop bouncing on hover */
}

.chatbot-toggle:active {
    transform: scale(0.98);
}

/* Dark mode styles for chat button */
[data-theme="dark"] .chatbot-toggle {
    background: white;
    color: black;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .chatbot-toggle:hover {
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
    background: #f5f5f5;
}

[data-theme="dark"] .chatbot-toggle i {
    color: black;
}

[data-theme="dark"] .chatbot-toggle-text {
    color: black;
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
    animation: bounce 0.5s ease;
}

.chatbot-notification.show {
    display: block;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(0, 132, 255, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 132, 255, 0.6);
    }
}

@keyframes bounceButton {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    /* Dynamic viewport height for mobile */
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    /* Prevent layout shift on mobile */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

[data-theme="dark"] .chatbot-container {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #0f172a, #0c8f70);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background 0.4s ease;
}

[data-theme="dark"] .chatbot-header {
    background: linear-gradient(135deg, #1a1a1a, #0c8f70);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Smooth scrolling on iOS/Android */
    -webkit-overflow-scrolling: touch;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior: contain;
    /* Ensure proper height calculation when keyboard is open */
    min-height: 0;
    max-height: 100%;
}

[data-theme="dark"] .chatbot-messages {
    background: #1a1a1a;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

[data-theme="dark"] .chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* FAQ Section */
.chatbot-faq-section {
    margin-top: 8px;
    margin-bottom: 8px;
    display: block;
    width: 100%;
}

.faq-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-weight: 500;
    line-height: 1.4;
}

.faq-button:hover {
    background: var(--bg-hover);
    border-color: var(--chatgpt-green);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(12, 143, 112, 0.15);
}

.faq-button:active {
    transform: translateX(2px);
}

[data-theme="dark"] .faq-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .faq-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--chatgpt-green);
}

/* Message Styles */
.chatbot-message {
    display: flex;
    gap: 8px;
    max-width: 80%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message.bot-message {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* User messages don't have avatars - removed */

.bot-message .message-avatar {
    background: #e4e6eb;
    border: 2px solid #d1d5db;
}

[data-theme="dark"] .bot-message .message-avatar {
    background: #404040;
    border: 2px solid #555;
}

.message-content {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

.user-message .message-content {
    background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #050505;
    border-bottom-left-radius: 4px;
}

[data-theme="dark"] .bot-message .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.message-time {
    display: block;
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.bot-message .message-time {
    color: #65676b;
}

[data-theme="dark"] .bot-message .message-time {
    color: var(--text-secondary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .typing-indicator {
    background: var(--bg-card);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #65676b;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

[data-theme="dark"] .typing-indicator span {
    background: var(--text-secondary);
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chatbot Input Container */
.chatbot-input-container {
    padding: 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.chatbot-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f2f5;
    border-radius: 24px;
    padding: 8px 12px;
}

[data-theme="dark"] .chatbot-input-wrapper {
    background: #2d2d2d;
}

#chatbotInput {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    padding: 4px 0;
}

#chatbotInput::placeholder {
    color: #65676b;
}

[data-theme="dark"] #chatbotInput::placeholder {
    color: var(--text-secondary);
}

.chatbot-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a, #0c8f70);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .chatbot-send {
    background: linear-gradient(135deg, #1a1a1a, #0c8f70);
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(12, 143, 112, 0.4);
}

.chatbot-send:active:not(:disabled) {
    transform: scale(0.95);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        width: 100vw;
        width: 100dvw;
        /* Dynamic viewport width for mobile */
        height: 100vh;
        height: 100dvh;
        /* Dynamic viewport height for mobile */
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 10000;
        /* Higher than chat button to overlay it */
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-header-text h3 {
        font-size: 15px;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .chatbot-input-container {
        padding: 10px;
    }

    .chatbot-toggle {
        min-width: 56px;
        height: 56px;
        padding: 0 16px;
        border-radius: 28px;
        bottom: 20px;
        right: 20px;
    }

    .chatbot-toggle i {
        font-size: 22px;
    }

    .chatbot-toggle-text {
        font-size: 14px;
    }

    /* Hide chat button when modal is open on mobile */
    body.modal-open .chatbot-toggle {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .chatbot-toggle {
        min-width: 50px;
        height: 50px;
        padding: 0 12px;
        border-radius: 25px;
        font-size: 14px;
    }

    .chatbot-toggle i {
        font-size: 20px;
    }

    .chatbot-toggle-text {
        font-size: 12px;
    }

    /* Hide chat button when modal is open on mobile */
    body.modal-open .chatbot-toggle {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 100vw;
        width: 100dvw;
        /* Dynamic viewport width for mobile */
        height: 100vh;
        height: 100dvh;
        /* Dynamic viewport height for mobile */
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
        z-index: 10000;
        /* Higher than chat button to overlay it */
        /* iOS safe area insets */
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .chatbot-header {
        padding: 12px 14px;
    }

    .chatbot-header-text h3 {
        font-size: 14px;
    }

    .chatbot-avatar {
        width: 36px;
        height: 36px;
    }

    .chatbot-messages {
        padding: 12px;
        gap: 10px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
    }

    .message-content {
        padding: 8px 12px;
        font-size: 13px;
    }

    .chatbot-input-container {
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px) + 8px);
        /* iOS safe area */
        /* Prevent input from being hidden by keyboard */
        position: relative;
        bottom: 0;
        background: var(--bg-card);
        z-index: 10;
        flex-shrink: 0;
        /* Ensure input stays above keyboard */
        border-top: 1px solid var(--border-color);
    }

    .chatbot-input-wrapper {
        padding: 6px 10px;
    }

    #chatbotInput {
        /* Prevent zoom on iOS when focusing input - must be 16px or larger */
        font-size: 16px;
    }

    .chatbot-toggle {
        bottom: max(15px, env(safe-area-inset-bottom, 0px) + 15px);
        /* iOS safe area */
        right: max(15px, env(safe-area-inset-right, 0px) + 15px);
        /* iOS safe area */
        min-width: 50px;
        height: 50px;
        padding: 0 12px;
        border-radius: 25px;
        font-size: 13px;
        /* Ensure button stays above iOS home indicator */
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }

    .chatbot-toggle i {
        font-size: 20px;
    }

    .chatbot-toggle-text {
        font-size: 12px;
    }

    .chatbot-message {
        max-width: 85%;
    }
}

/* Very small screens - hide text, show only icon */
@media (max-width: 360px) {
    .chatbot-toggle {
        min-width: 50px;
        width: 50px;
        height: 50px;
        padding: 0;
        border-radius: 50%;
    }

    .chatbot-toggle-text {
        display: none;
    }

    .chatbot-toggle i {
        font-size: 22px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-container {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
        /* Full screen in landscape */
        max-height: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        z-index: 10000;
        /* Higher than chat button to overlay it */
    }

    .chatbot-toggle {
        bottom: max(15px, env(safe-area-inset-bottom, 0px) + 15px);
        right: max(15px, env(safe-area-inset-right, 0px) + 15px);
    }

    .chatbot-messages {
        padding: 12px;
    }

    .chatbot-header {
        padding: 10px 14px;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .chatbot-container {
        /* Fix iOS Safari viewport issues */
        height: -webkit-fill-available;
    }

    .chatbot-messages {
        /* Better scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    #chatbotInput {
        /* Prevent iOS zoom on input focus */
        font-size: 16px !important;
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .chatbot-container {
        /* Better rendering on Android */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .chatbot-toggle {
        /* Larger touch target for mobile */
        min-width: 56px;
        min-height: 56px;
    }

    .chatbot-send {
        /* Larger send button for touch */
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .message-content {
        /* Better touch interaction */
        -webkit-tap-highlight-color: transparent;
    }

    .chatbot-close {
        /* Larger close button */
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}