/* Adaptive Layouts with Responsive Design System */

/* ===== RESPONSIVE BREAKPOINTS & MIXINS ===== */
:root {
    /* Fluid Typography */
    --text-xs: clamp(0.75rem, 1vw, 0.875rem);
    --text-sm: clamp(0.875rem, 1.2vw, 1rem);
    --text-base: clamp(1rem, 1.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 2vw, 1.5rem);
    --text-xl: clamp(1.25rem, 2.5vw, 2rem);
    --text-2xl: clamp(1.5rem, 3vw, 2.5rem);
    --text-3xl: clamp(1.875rem, 4vw, 3rem);

    /* Responsive Spacing */
    --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --space-sm: clamp(0.5rem, 1vw, 1rem);
    --space-md: clamp(1rem, 2vw, 1.5rem);
    --space-lg: clamp(1.5rem, 3vw, 2rem);
    --space-xl: clamp(2rem, 4vw, 3rem);

    /* Responsive Dimensions */
    --header-height: 70px;
    --section-padding: 2rem;
    --container-padding: clamp(1rem, 3vw, 2rem);

    /* Grid and Layout */
    --grid-gap: clamp(1rem, 2vw, 2rem);
    --border-radius-sm: clamp(4px, 0.5vw, 8px);
    --border-radius: clamp(6px, 0.8vw, 12px);

    /* Component Sizing */
    --button-padding-y: 0.625rem;
    --button-padding-x: clamp(1rem, 2vw, 1.5rem);
    --card-padding: clamp(1rem, 2vw, 2rem);
}

/* Remove all scrollable containers */
.section .container {
    overflow: hidden !important;
}

.education-cards-deck,
.experience-cards-container,
.projects-grid,
.skills-grid-container,
.achievements-content,
.contact-content {
    overflow: hidden !important;
}

/* ===== EDUCATION SECTION ===== */

/* Tabs Layout */
.education-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.tab-button {
    padding: var(--button-padding-y) var(--button-padding-x);
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-heading, var(--font-family));
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    min-height: 44px; /* Touch target size */
}

.tab-button.active,
.tab-button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.education-content {
    flex: 1;
    position: relative;
    height: calc(100vh - var(--header-height) - 180px);
}

.tab-content {
    display: none;
    height: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

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

/* Education Cards - Responsive Layout */
.education-card-compact {
    display: grid;
    gap: var(--space-lg);
    align-items: center;
    height: 100%;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    transition: all 0.3s ease;
}

/* Mobile Layout */
@media (max-width: 767px) {
    .education-card-compact {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-md);
    }

    .education-right {
        order: -1;
    }

    .education-content {
        height: calc(100vh - var(--header-height) - 140px);
    }

    /* Vertically center text in Schooling tab (no image) */
    #school-tab .education-card-compact {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #school-tab .education-right {
        display: none;
    }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1023px) {
    .education-card-compact {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-lg);
    }
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .education-card-compact {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-xl);
    }

    .education-card-compact:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        border-color: var(--primary);
    }
}

.education-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.degree-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

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

.duration {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.education-details p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.5;
}

.education-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.education-image {
    width: 100%;
    max-width: clamp(150px, 20vw, 250px);
    height: clamp(120px, 15vw, 200px);
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Master's Degree image - 44% larger with correct portrait aspect ratio */
#masters-tab .education-image {
    max-width: clamp(216px, 28.8vw, 360px);
    height: clamp(288px, 38.4vw, 480px);
    object-fit: cover;
}

/* Bachelor's Degree - Adjust layout to give more space to image */
@media (min-width: 768px) and (max-width: 1023px) {
    #bachelors-tab .education-card-compact {
        grid-template-columns: 1.66fr 1.34fr;
    }
}

@media (min-width: 1024px) {
    #bachelors-tab .education-card-compact {
        grid-template-columns: 1.38fr 1.62fr;
    }
}

/* Bachelor's Degree image - larger with landscape aspect ratio */
#bachelors-tab .education-image {
    max-width: clamp(351px, 46.9vw, 586px);
    height: clamp(281px, 35.1vw, 469px);
    object-fit: cover;
}

.details-btn {
    padding: var(--space-xs) var(--space-sm);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    font-size: var(--text-xs);
    font-weight: 500;
    min-height: 36px;
}

.details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 151, 167, 0.3);
}

/* ===== EXPERIENCE SECTION ===== */

.experience-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow-y: visible;
}

/* Mobile: Dynamic height to fit content */
@media (max-width: 767px) {
    .experience-accordion {
        gap: clamp(0.438rem, 0.875vw, 0.875rem);
    }
}

/* Tablet: Balanced layout */
@media (min-width: 768px) and (max-width: 1023px) {
    .experience-accordion {
        gap: var(--space-sm);
    }
}

/* Desktop: Full layout */
@media (min-width: 1024px) {
    .experience-accordion {
        gap: var(--space-md);
    }
}

.experience-item {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    overflow: visible;
    transition: all 0.3s ease;
    flex: 1;
    min-height: 0;
}

/* Mobile: Allow natural height for content */
@media (max-width: 767px) {
    .experience-item {
        flex: none;
        height: auto;
        min-height: auto;
    }
}

.experience-item:hover {
    border-color: var(--primary);
}

@media (min-width: 1024px) {
    .experience-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: white;
    transition: all 0.3s ease;
    padding: var(--space-md);
    min-height: 60px;
}

/* Mobile: Compact header */
@media (max-width: 767px) {
    .experience-header {
        padding: var(--space-sm);
        min-height: 50px;
    }
}

/* Tablet: Medium header */
@media (min-width: 768px) and (max-width: 1023px) {
    .experience-header {
        padding: var(--space-md);
        min-height: 55px;
    }
}

.experience-header:hover {
    background: var(--primary);
    color: white;
    opacity: 0.9;
}

.experience-header h3 {
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: white;
}

/* Dark mode: Keep heading text white for blue background */
[data-theme="dark"] .experience-header h3 {
    color: white;
}

/* Responsive header text sizing - Scaled to use 80% of container, increased by 20% for mobile, now 15% larger */
@media (max-width: 767px) {
    .experience-header h3 {
        font-size: clamp(1.503rem, 5.84vw, 1.837rem);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .experience-header h3 {
        font-size: clamp(1.392rem, 3.9vw, 1.809rem);
    }
}

@media (min-width: 1024px) {
    .experience-header h3 {
        font-size: calc(var(--text-base) * 1.265);
    }
}

.experience-company {
    color: rgba(255, 255, 255, 0.9);
    margin-top: var(--space-xs);
}

/* Dark mode: Change company text to black */
[data-theme="dark"] .experience-company {
    color: rgba(0, 0, 0, 0.8);
}

/* Responsive company text sizing - increased by 20% for mobile */
@media (max-width: 767px) {
    .experience-company {
        font-size: clamp(0.84rem, 3.36vw, 1.02rem);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .experience-company {
        font-size: clamp(0.75rem, 2.2vw, 0.9rem);
    }
}

@media (min-width: 1024px) {
    .experience-company {
        font-size: var(--text-xs);
    }
}

.experience-header:hover .experience-company {
    color: rgba(255, 255, 255, 0.8);
}

/* Dark mode: Change hover state for company text */
[data-theme="dark"] .experience-header:hover .experience-company {
    color: rgba(0, 0, 0, 0.7);
}

.experience-body {
    display: block;
    max-height: none;
    overflow: visible;
    flex: 1;
    min-height: 0;
}

/* Mobile: Natural content flow with additional padding */
@media (max-width: 767px) {
    .experience-body {
        flex: none;
        height: auto;
        padding: 0 5px 5px 5px;
    }
}

.experience-content-inner {
    padding: var(--space-md);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Mobile: Compact content */
@media (max-width: 767px) {
    .experience-content-inner {
        padding: var(--space-sm);
    }
}

/* Tablet: Medium content */
@media (min-width: 768px) and (max-width: 1023px) {
    .experience-content-inner {
        padding: var(--space-sm) var(--space-md);
    }
}

.experience-period {
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    font-weight: 500;
    flex-shrink: 0;
}

/* Responsive period text sizing - increased by 20% for mobile */
@media (max-width: 767px) {
    .experience-period {
        font-size: clamp(0.72rem, 3vw, 0.9rem);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .experience-period {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }
}

@media (min-width: 1024px) {
    .experience-period {
        font-size: var(--text-xs);
    }
}

.experience-description {
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
}

/* Responsive description text sizing - autoscaled to fill 80% of container, increased by 10% for mobile */
@media (max-width: 767px) {
    .experience-description {
        font-size: clamp(0.66rem, 3.08vw, 0.88rem);
        line-height: 1.4;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .experience-description {
        font-size: clamp(0.65rem, 2.2vw, 0.85rem);
        line-height: 1.5;
    }
}

@media (min-width: 1024px) {
    .experience-description {
        font-size: var(--text-sm);
        line-height: 1.6;
    }
}

/* ===== PROJECTS SECTION ===== */

.projects-grid-compact {
    display: grid;
    gap: var(--grid-gap);
    overflow-y: visible;
}

/* Mobile: 2 columns */
@media (max-width: 767px) {
    .projects-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
}

/* Tablet: 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .projects-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
}

/* Desktop: 3 columns, larger cards */
@media (min-width: 1024px) {
    .projects-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--grid-gap);
    }
}

.project-card-mini {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    min-height: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.project-card-mini:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16), 0 0 30px rgba(0, 151, 167, 0.15);
    border-color: var(--accent, var(--primary));
}

.project-card-mini h3 {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.3;
}

/* Tablet: Larger project titles (15% increase) */
@media (min-width: 768px) and (max-width: 1023px) {
    .project-card-mini h3 {
        font-size: clamp(1.15rem, 2.3vw, 1.29rem);
    }
}

/* Desktop: Slightly reduced project titles (5% decrease from text-lg) */
@media (min-width: 1024px) {
    .project-card-mini h3 {
        font-size: clamp(1.49rem, 1.9vw, 1.92rem);
    }
}

.project-date-mini {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    color: var(--primary);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

/* Tablet: Larger project dates (15% increase) */
@media (min-width: 768px) and (max-width: 1023px) {
    .project-date-mini {
        font-size: clamp(1.01rem, 1.38vw, 1.15rem);
    }
}

/* Desktop: Slightly reduced project dates (5% decrease from text-base) */
@media (min-width: 1024px) {
    .project-date-mini {
        font-size: clamp(0.95rem, 1.425vw, 1.07rem);
    }
}

.project-summary {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tablet: Larger project summaries (15% increase) */
@media (min-width: 768px) and (max-width: 1023px) {
    .project-summary {
        font-size: clamp(1.01rem, 1.38vw, 1.15rem);
        -webkit-line-clamp: 4;
        line-height: 1.5;
    }
}

/* Desktop: Slightly reduced project summaries (5% decrease from text-base) */
@media (min-width: 1024px) {
    .project-summary {
        font-size: clamp(0.95rem, 1.425vw, 1.07rem);
        -webkit-line-clamp: 4;
        line-height: 1.6;
    }
}

.view-project-btn {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent, var(--primary)) 100%);
    border: 1px solid var(--primary);
    border-radius: 50px;
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 36px;
}

/* Tablet: Larger buttons (15% increase) */
@media (min-width: 768px) and (max-width: 1023px) {
    .view-project-btn {
        font-size: clamp(1.01rem, 1.38vw, 1.15rem);
        padding: var(--space-sm) var(--space-md);
        min-height: 40px;
    }
}

/* Desktop: Slightly reduced buttons (5% decrease from text-base) */
@media (min-width: 1024px) {
    .view-project-btn {
        font-size: clamp(0.95rem, 1.425vw, 1.07rem);
        padding: var(--space-sm) var(--space-lg);
        min-height: 44px;
    }
}

.view-project-btn:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-1px);
}

/* ===== SKILLS SECTION ===== */

.skills-categories {
    display: grid;
    gap: var(--grid-gap);
    overflow-y: visible;
}

/* Mobile: Single column with compact spacing */
@media (max-width: 767px) {
    .skills-categories {
        grid-template-columns: 1fr;
        gap: clamp(0.5rem, 1vw, 1rem);
    }
}

/* Tablet: 2 columns with balanced spacing */
@media (min-width: 768px) and (max-width: 1023px) {
    .skills-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
}

/* Desktop: 2x2 grid with full spacing */
@media (min-width: 1024px) {
    .skills-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--grid-gap);
    }
}

.skill-category {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Allow Robotics and Other skill categories to size naturally based on content */
@media (min-width: 768px) {
    .skill-category:nth-child(3),
    .skill-category:nth-child(4) {
        align-self: start;
    }
}

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

@media (min-width: 1024px) {
    .skill-category:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
}

.skill-category-header {
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: var(--space-md);
    min-height: 60px;
}

/* Mobile: Compact header */
@media (max-width: 767px) {
    .skill-category-header {
        padding: var(--space-sm);
        min-height: 45px;
    }
}

/* Tablet: Medium header */
@media (min-width: 768px) and (max-width: 1023px) {
    .skill-category-header {
        padding: var(--space-sm) var(--space-md);
        min-height: 50px;
    }
}

.skill-category-header:hover {
    background: var(--primary);
    color: white;
    opacity: 0.9;
}

.skill-category-header h3 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: white;
}

/* Dark mode: Keep skills heading text white for blue background */
[data-theme="dark"] .skill-category-header h3 {
    color: white;
}

/* Responsive header text sizing - autoscaled to fill 80% of container, now 15% larger */
@media (max-width: 767px) {
    .skill-category-header h3 {
        font-size: clamp(1.183rem, 4.45vw, 1.392rem);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .skill-category-header h3 {
        font-size: clamp(1.252rem, 3.48vw, 1.531rem);
    }
}

@media (min-width: 1024px) {
    .skill-category-header h3 {
        font-size: calc(var(--text-base) * 1.265);
    }
}

.skill-category-body {
    display: block;
    max-height: none;
    overflow: visible;
    flex: 1;
    min-height: 0;
}

.skills-list-compact {
    padding: var(--space-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    height: 100%;
    align-content: flex-start;
}

/* Mobile: Compact skills list */
@media (max-width: 767px) {
    .skills-list-compact {
        padding: var(--space-sm);
        gap: 4px;
    }
}

/* Tablet: Medium skills list */
@media (min-width: 768px) and (max-width: 1023px) {
    .skills-list-compact {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-xs);
    }
}

.skills-list-compact span {
    background: var(--background-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    font-size: clamp(0.75rem, 1.8vw, 0.875rem);
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: default;
    white-space: nowrap;
    flex-shrink: 0;
    padding: clamp(0.25rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 0.75rem);
}

/* Dark mode styling for Experience and Skills headers - keep primary blue */
[data-theme="dark"] .experience-header {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .experience-header:hover {
    background: var(--primary);
    opacity: 0.8;
}

[data-theme="dark"] .skill-category-header {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .skill-category-header:hover {
    background: var(--primary);
    opacity: 0.8;
}

/* Responsive skill tag sizing - autoscaled to fill 80% of container */
@media (max-width: 767px) {
    .skills-list-compact span {
        padding: 4px 6px;
        font-size: clamp(8px, 2.2vw, 11px);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .skills-list-compact span {
        padding: var(--space-xs) 8px;
        font-size: clamp(10px, 1.8vw, 12px);
    }
}

@media (min-width: 1024px) {
    .skills-list-compact span {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-xs);
    }
}

.skills-list-compact span:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== ACHIEVEMENTS SECTION ===== */

/* Desktop: Natural content flow for achievements section */
@media (min-width: 1024px) {
    .achievements-section .container {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--section-padding);
        margin-top: var(--header-height);
    }

    .achievements-section .section-title {
        margin-bottom: var(--space-lg);
    }
}

.achievements-grid {
    display: grid;
    gap: var(--grid-gap);
    overflow-y: visible;
}

/* Mobile: Single column */
@media (max-width: 767px) {
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 4px;
        overflow-y: auto;
        padding-top: var(--space-sm);
    }

    /* Achievement cards responsive to width only */
    .achievement-card-compact {
        min-height: 100px;
        padding: var(--space-xs);
        width: 90%;
        margin: 0 auto;
        gap: var(--space-xs);
    }

    /* Reduce text sizes and spacing for mobile achievements */
    .achievement-card-compact h3 {
        font-size: var(--text-sm);
        margin: 0 0 4px 0;
        line-height: 1.2;
    }

    .achievement-card-compact .achievement-detail {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .achievement-card-compact .achievement-description {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .view-patent-btn {
        margin-top: 4px;
        padding: 4px 8px;
        font-size: 10px;
        min-height: 28px;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        overflow-y: visible;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
        overflow-y: visible;
        height: auto;
    }
}

.achievement-card-compact {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    min-height: 180px;
}

/* Desktop: Natural sizing based on content */
@media (min-width: 1024px) {
    .achievement-card-compact {
        padding: var(--space-sm);
        min-height: 240px;
    }

    .achievement-card-compact h3 {
        font-size: var(--text-base);
        margin: 0 0 var(--space-xs) 0;
        line-height: 1.2;
    }

    .achievement-card-compact .achievement-detail {
        font-size: var(--text-xs);
        margin-bottom: var(--space-xs);
    }

    .achievement-card-compact .achievement-description {
        font-size: var(--text-sm);
        line-height: 1.4;
        margin-bottom: var(--space-sm);
    }

    .view-patent-btn {
        margin-top: var(--space-xs);
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-xs);
        min-height: 32px;
    }
}

.achievement-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 20px rgba(0, 151, 167, 0.1);
    border-color: var(--accent, var(--primary));
}

.achievement-card-compact h3 {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.3;
}

.achievement-card-compact .achievement-detail {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: var(--primary);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.achievement-card-compact .achievement-description {
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
}

.view-patent-btn {
    display: inline-flex;
    margin-top: var(--space-sm);
    padding: clamp(0.375rem, 1.5vw, 0.5rem) clamp(0.5rem, 2vw, 0.75rem);
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-height: clamp(32px, 8vw, 40px);
    align-items: center;
    justify-content: center;
}

.view-patent-btn:hover {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    transform: translateY(-1px);
}

/* ===== CONTACT SECTION ===== */

.contact-split {
    display: grid;
    gap: var(--space-xl);
    align-items: flex-start;
}

/* Mobile: Single column */
@media (max-width: 767px) {
    .contact-split {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* Tablet & Desktop: Two columns */
@media (min-width: 768px) {
    .contact-split {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-info-compact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
}

.contact-info-compact h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.contact-info-compact p {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    color: var(--text-secondary);
    line-height: 1.5;
}

.contact-details-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.contact-item-compact {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

.contact-item-compact a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

.contact-form-compact {
    background: var(--background-secondary);
    padding: var(--space-lg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    height: fit-content;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group-compact label {
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group-compact input,
.form-group-compact textarea {
    padding: clamp(0.5rem, 2vw, 0.75rem);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    transition: border-color 0.3s ease;
    min-height: clamp(40px, 10vw, 48px);
}

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

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

.contact-form-compact .btn {
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: clamp(44px, 10vw, 52px);
    margin-top: 10px;
}

.contact-form-compact .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 151, 167, 0.3);
}

/* ===== MODAL STYLES ===== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: rgba(240, 242, 245, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    max-width: clamp(300px, 85vw, 600px);
    max-height: clamp(400px, 80vh, 700px);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

[data-theme="dark"] .modal-content {
    background: rgba(18, 18, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: var(--text-2xl);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    padding-right: var(--space-xl);
    line-height: 1.3;
}

.modal-content .project-date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.modal-content p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.modal-content .project-links {
    margin-top: var(--space-lg);
}

.modal-content .btn {
    font-size: var(--text-sm);
    padding: var(--button-padding-y) var(--button-padding-x);
}

/* ===== RESPONSIVE UTILITIES ===== */

/* Touch-friendly minimum sizes */
@media (max-width: 767px) {
    .tab-button,
    .details-btn,
    .view-project-btn,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* High-resolution displays */
@media (min-resolution: 2dppx) {
    .education-image,
    .project-card-mini,
    .achievement-card-compact {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Footer responsive */
@media (max-width: 767px) {
    .footer-container {
        flex-direction: column;
        gap: 1rem;
    }

    .resume-tabs-selector {
        flex-direction: column;
        border-radius: var(--border-radius);
    }

    .resume-tab {
        padding: 0.5rem 1rem;
    }
}

/* Print styles */
@media print {
    .modal {
        display: none !important;
    }

    .tab-content:not(.active) {
        display: block !important;
    }

    .experience-body {
        max-height: none !important;
    }

    .skill-category-body {
        max-height: none !important;
    }
}