/* ========================================
   CRITICAL CAROUSEL IMAGE VISIBILITY FIX
   ======================================== */

/* MAIN FIX: Override the problematic display: none rule from index.css */
.carousel-image {
    display: block !important; /* Force display for ALL carousel images */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    opacity: 0 !important; /* Use opacity for transitions, not display */
    transition: opacity 0.6s ease-in-out !important;
    z-index: 1 !important;
}

.carousel-image.active {
    display: block !important; /* Ensure active image is always displayed */
    opacity: 1 !important;
    z-index: 2 !important;
}

/* Ensure non-active images remain visible but transparent */
.carousel-image:not(.active) {
    display: block !important; /* Override index.css display: none rule */
    opacity: 0 !important;
    z-index: 1 !important;
}

/* Desktop hover effects (only if image is visible) */
@media (hover: hover) {
    .carousel-image:hover {
        transform: scale(1.02) !important;
    }
}

/* Remove hover effects on mobile */
@media (hover: none) and (pointer: coarse) {
    .carousel-image:hover {
        transform: none !important;
    }
}

/* Ensure carousel container is properly set up */
.carousel-images-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* ========================================
   END CRITICAL CAROUSEL IMAGE FIX
   ======================================== */

/* ========================================
   CREATIVE MINIMALIST HEADER DESIGN
   ======================================== */

/* Main header - ultra clean design */
.header {
    position: static;
    top: auto;
    z-index: 1000;
    margin: 0;
    padding: 25px 0;
}

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

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    position: relative;
}

/* Hide brand since removed */
.brand {
    display: none;
}

/* Centered desktop navigation */
.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    color: var(--primary-gold);
    background: rgba(251, 191, 36, 0.1);
}

/* Mobile menu overlay - completely separate */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.mobile-menu.active .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.4s; }

.mobile-nav-link:hover {
    color: var(--primary-gold);
    transform: scale(1.1);
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Footer styles */
.main-footer {
    background: var(--bg-card);
    border-radius: 20px;
    margin-top: 40px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.main-footer:hover {
    border-color: var(--border-hover);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    gap: 30px;
}

.footer-info {
    flex: 1;
}

.footer-copyright {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    text-align: left;
}

/* Footer buttons container */
.footer-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Footer button styling */
.footer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid var(--border-primary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.footer-btn:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
    text-decoration: none;
}

/* Footer button icons */
.footer-btn-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Specific button styles */
.footer-btn-resume {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.footer-btn-resume:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #60a5fa;
    color: #60a5fa;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.footer-btn-github {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.footer-btn-github:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #a5b4fc;
    color: #a5b4fc;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.footer-btn-linkedin {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.footer-btn-linkedin:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile styles */
@media (max-width: 768px) {
    .header {
        margin: 0;
        padding: 8px 0;
    }

    .header-inner {
        padding: 0 15px;
    }

    .nav-container {
        height: 36px;
        padding: 0 15px;
        justify-content: center;
    }

    /* Hide brand on mobile since removed */
    .brand {
        display: none !important;
    }

    /* Show hamburger on mobile - sized to match compact header */
    .menu-btn {
        display: flex !important;
        right: 12px;
        width: 20px;
        height: 14px;
    }

    .menu-btn span {
        height: 1.5px;
    }

    .menu-btn.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
        background: var(--primary-gold);
    }

    .menu-btn.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
        background: var(--primary-gold);
    }

    /* Hide desktop nav on mobile */
    .nav-links {
        display: none !important;
    }

    .mobile-nav-link {
        font-size: 1.8rem;
    }

    /* Footer mobile styles */
    .footer-container {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }

    .footer-info {
        order: 1;
    }

    .footer-copyright {
        font-size: 13px;
        text-align: center;
    }

    .footer-buttons {
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    .footer-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .footer-btn-icon {
        width: 14px;
        height: 14px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .header {
        padding: 6px 0;
    }

    .header-inner {
        padding: 0 12px;
    }

    .nav-container {
        padding: 0 12px;
        height: 32px;
    }

    .menu-btn {
        right: 10px;
        width: 18px;
        height: 12px;
    }

    .menu-btn span {
        height: 1.5px;
    }

    .menu-btn.active span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    .menu-btn.active span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    .mobile-nav-link {
        font-size: 1.6rem;
    }

    /* Footer mobile styles */
    .footer-container {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }

    .footer-info {
        order: 1;
    }

    .footer-copyright {
        font-size: 13px;
        text-align: center;
    }

    .footer-buttons {
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    .footer-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .footer-btn-icon {
        width: 14px;
        height: 14px;
    }
}

/* ========================================
   HOME PAGE MOBILE FIXES
   ======================================== */

@media (max-width: 768px) {
    /* Hero section - stack vertically */
    .hero-inner {
        display: flex !important;
        flex-direction: column;
        gap: 30px;
        text-align: center;
        align-items: center;
    }

    .hero-content {
        order: 2;
        width: 100%;
        max-width: 500px;
    }

    .hero-image-container {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero-profile-avatar {
        width: 120px;
        height: 120px;
        font-size: 48px;
        margin: 0 auto;
    }

    .hero-name {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 15px;
        text-align: center;
    }

    .hero-title {
        font-size: 1.3rem !important;
        margin-bottom: 20px;
        text-align: center;
    }

    .hero-description {
        font-size: 1rem !important;
        margin-bottom: 25px;
        line-height: 1.6;
        text-align: center;
        padding: 0 10px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    .cta-primary, .cta-secondary {
        width: 100%;
        max-width: 280px;
        padding: 16px 24px;
        font-size: 16px;
        text-align: center;
        display: inline-block;
    }

    /* Skills section - single column */
    .simple-skills-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px;
        max-width: 500px;
        margin: 0 auto;
    }

    .simple-skill-content {
        padding: 25px 20px;
        text-align: center;
    }

    .simple-skill-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
        text-align: center;
    }

    .simple-skill-tags {
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tech-tag {
        font-size: 0.85rem;
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* Services section - single column */
    .services-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 25px;
        max-width: 600px;
        margin: 0 auto;
    }

    .service-content {
        padding: 30px 25px;
        text-align: center;
    }

    .service-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
        text-align: center;
    }

    .service-description {
        font-size: 1rem;
        margin-bottom: 20px;
        line-height: 1.6;
        text-align: center;
    }

    .service-features {
        max-width: 400px;
        margin: 0 auto;
        text-align: left;
    }

    .service-features li {
        font-size: 0.9rem;
        padding: 10px 0;
    }

    /* Projects section - single column */
    .projects-preview-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 25px;
        max-width: 600px;
        margin: 0 auto;
    }

    .project-content {
        padding: 25px;
        text-align: center;
    }

    .project-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
        text-align: center;
    }

    .project-description {
        font-size: 1rem;
        margin-bottom: 20px;
        line-height: 1.6;
        text-align: center;
    }

    .tech-stack {
        gap: 8px;
        margin-bottom: 20px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .project-image-container {
        height: 200px;
        margin-bottom: 20px;
    }

    /* CTA section mobile */
    .cta-content {
        padding: 40px 25px;
        max-width: 500px;
        margin: 0 auto;
        text-align: center;
    }

    .cta-title {
        font-size: 2.2rem;
        margin-bottom: 20px;
        text-align: center;
    }

    .cta-description {
        font-size: 1.1rem;
        margin-bottom: 30px;
        line-height: 1.6;
        text-align: center;
    }

    .cta-actions {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    /* Section titles mobile */
    .section-title {
        font-size: 2.2rem !important;
        margin-bottom: 15px;
        text-align: center;
    }

    .section-subtitle {
        font-size: 1rem !important;
        margin-bottom: 30px;
        text-align: center;
        padding: 0 10px;
    }
}

/* Hamburger button for mobile */
.menu-btn {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.menu-btn:hover span {
    background: var(--primary-gold);
}

.menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: var(--primary-gold);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--primary-gold);
}

/* ========================================
   ABOUT PAGE SPECIFIC FIXES
   ======================================== */

/* Fix paragraph spacing - make words closer together */
.about-page .about-description {
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
}

.about-page .about-description:last-child {
    margin-bottom: 0 !important;
}

/* Fix tech skill description paragraphs */
.about-page .tech-skill-description {
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
}

.about-page .cert-description {
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
}

/* Fix skill-item-detailed mobile overflow */
@media (max-width: 768px) {
    .about-page .skill-item-detailed {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 70% !important;
        gap: 8px !important;
        padding: 12px 14px !important;
    }

    .about-page .tech-tag-detailed {
        font-size: 0.9rem !important;
        word-wrap: break-word !important;
        max-width: 100% !important;
    }

    .about-page .skill-level {
        align-self: flex-end !important;
        font-size: 0.75rem !important;
        padding: 3px 10px !important;
    }

    /* Make tech skills grid single column on mobile */
    .about-page .tech-skills-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .about-page .tech-skill-card {
        margin-bottom: 20px !important;
    }

    /* Adjust tech skills list spacing */
    .about-page .tech-skills-list {
        gap: 8px !important;
    }

    /* Fix education and certification cards spacing */
    .about-page .education-grid,
    .about-page .certifications-grid {
        gap: 20px !important;
    }

    /* Tighter spacing for about content */
    .about-page .about-text-section {
        gap: 20px !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .about-page .skill-item-detailed {
        padding: 10px 12px !important;
        width: 100% !important;
    }

    .about-page .tech-tag-detailed {
        font-size: 0.85rem !important;
    }

    .about-page .skill-level {
        font-size: 0.7rem !important;
        padding: 2px 8px !important;
    }

    /* Even tighter paragraph spacing on small screens */
    .about-page .about-description {
        line-height: 1.5 !important;
        margin-bottom: 14px !important;
        text-align: center !important; /* Remove justify alignment on mobile */
    }

    .about-page .tech-skill-description {
        line-height: 1.5 !important;
        margin-bottom: 14px !important;
        text-align: center !important; /* Remove justify alignment on mobile */
    }

    .about-page .cert-description {
        text-align: center !important; /* Remove justify alignment on mobile */
    }
}

/* Mobile text alignment fix for all mobile sizes */
@media (max-width: 768px) {
    .about-page .about-description,
    .about-page .tech-skill-description,
    .about-page .cert-description {
        text-align: center !important; /* Remove justify alignment on all mobile devices */
    }
}

/* ========================================
   CONTACT PAGE OVERFLOW FIXES
   ======================================== */

/* Fix main container overflow issues on mobile */
@media (max-width: 768px) {
    /* Ensure contact container stays within bounds */
    .contact-container {
        max-width: 100% !important;
        padding: 8px !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    /* Fix hero section overflow */
    .contact-hero {
        margin: 0 0 15px 0 !important;
        padding: 25px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    .contact-hero-content {
        max-width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    /* Fix main contact section overflow */
    .contact-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Fix form section overflow */
    .contact-form-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px 15px !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    .form-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .contact-form {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Fix form inputs overflow */
    .form-input, .form-textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .submit-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    /* Fix contact info column overflow */
    .contact-info-column {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .contact-info-section,
    .social-section,
    .availability-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 15px 0 !important;
        padding: 15px !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Fix contact info grid overflow */
    .contact-info-grid {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .contact-info-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
        word-wrap: break-word;
    }

    .contact-info-content {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .contact-info-text,
    .contact-info-subtitle {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    /* Fix social links overflow */
    .social-links-grid {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .social-link {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Fix availability card overflow */
    .availability-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .availability-content {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .availability-text,
    .availability-subtitle {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    /* Fix form status overflow */
    .form-status {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 15px 0 0 0 !important;
        overflow: hidden;
    }

    .status-content {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
}

/* Small mobile specific fixes */
@media (max-width: 480px) {
    .contact-container {
        padding: 3px !important;
    }

    .contact-hero {
        padding: 15px 8px !important;
        margin: 0 0 8px 0 !important;
    }

    .contact-hero-title {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }

    .contact-hero-subtitle {
        font-size: 13px !important;
    }

    .contact-main {
        gap: 8px !important;
        margin: 0 0 8px 0 !important;
    }

    .contact-form-section {
        padding: 12px 8px !important;
    }

    .contact-form-title {
        font-size: 18px !important;
    }

    .contact-form-subtitle {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .contact-form {
        gap: 12px !important;
    }

    .form-group {
        gap: 5px !important;
    }

    .form-label {
        font-size: 13px !important;
        margin-bottom: 5px !important;
    }

    .form-input, .form-textarea {
        padding: 10px 12px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
        border-radius: 8px !important;
    }

    .form-textarea {
        min-height: 70px !important;
    }

    .submit-btn {
        padding: 12px 20px !important;
        font-size: 13px !important;
        min-height: 44px !important; /* Touch friendly */
    }

    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 12px 10px !important;
        margin: 0 0 10px 0 !important;
    }

    .info-section-title {
        font-size: 16px !important;
        margin-bottom: 10px !important;
        word-wrap: break-word;
    }

    .contact-info-item {
        padding: 8px !important;
        gap: 8px !important;
    }

    .contact-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
        flex-shrink: 0;
    }

    .contact-info-title {
        font-size: 13px !important;
        margin-bottom: 2px !important;
        word-wrap: break-word;
    }

    .contact-info-text {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .contact-info-subtitle {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    /* Social links single column on small mobile */
    .social-links-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .social-link {
        padding: 8px 10px !important;
        gap: 8px !important;
        font-size: 12px !important;
        min-height: 40px !important;
    }

    .social-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
        flex-shrink: 0;
    }

    .availability-card {
        padding: 10px !important;
        gap: 8px !important;
    }

    .availability-title {
        font-size: 13px !important;
        margin-bottom: 4px !important;
        word-wrap: break-word;
    }

    .availability-text {
        font-size: 11px !important;
        margin-bottom: 2px !important;
        line-height: 1.3 !important;
    }

    .availability-subtitle {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    .status-indicator {
        font-size: 12px !important;
        flex-shrink: 0;
    }
}

/* Extra small mobile fixes */
@media (max-width: 360px) {
    .contact-container {
        padding: 3px !important;
    }

    .contact-hero {
        padding: 15px 8px !important;
        margin: 0 0 8px 0 !important;
    }

    .contact-hero-title {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }

    .contact-hero-subtitle {
        font-size: 13px !important;
    }

    .contact-main {
        gap: 8px !important;
        margin: 0 0 8px 0 !important;
    }

    .contact-form-section {
        padding: 12px 8px !important;
    }

    .contact-form-title {
        font-size: 18px !important;
    }

    .contact-form-subtitle {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .contact-form {
        gap: 12px !important;
    }

    .form-input, .form-textarea {
        padding: 8px 10px !important;
        font-size: 16px !important;
    }

    .form-textarea {
        min-height: 60px !important;
    }

    .submit-btn {
        padding: 10px 16px !important;
        font-size: 12px !important;
        min-height: 40px !important;
    }

    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 10px 8px !important;
        margin: 0 0 8px 0 !important;
    }

    .info-section-title {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .contact-info-item {
        padding: 6px !important;
        gap: 6px !important;
    }

    .contact-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 14px !important;
    }

    .contact-info-title {
        font-size: 12px !important;
    }

    .contact-info-text {
        font-size: 10px !important;
    }

    .contact-info-subtitle {
        font-size: 9px !important;
    }

    /* Social links single column on small mobile */
    .social-links-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .social-link {
        padding: 6px 8px !important;
        font-size: 11px !important;
        min-height: 36px !important;
    }

    .social-icon {
        width: 20px !important;
        height: 20px !important;
        font-size: 11px !important;
    }

    .availability-card {
        padding: 8px !important;
    }

    .availability-title {
        font-size: 12px !important;
    }

    .availability-text {
        font-size: 10px !important;
    }

    .availability-subtitle {
        font-size: 9px !important;
    }
}

/* Landscape mobile optimizations to prevent overflow */
@media (max-width: 768px) and (orientation: landscape) {
    .contact-hero {
        padding: 15px 10px !important;
    }

    .contact-hero-title {
        font-size: 28px !important;
    }

    .contact-hero-subtitle {
        font-size: 15px !important;
    }

    .contact-main {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }

    .contact-form-section {
        order: 1;
    }

    .contact-info-column {
        order: 2;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .contact-main {
        grid-template-columns: 1fr !important;
    }

    .form-textarea {
        min-height: 50px !important;
    }
}

/* Ensure proper box-sizing for all contact elements */
.contact-container,
.contact-hero,
.contact-hero-content,
.contact-main,
.contact-form-section,
.form-container,
.contact-form,
.form-group,
.form-input,
.form-textarea,
.submit-btn,
.contact-info-column,
.contact-info-section,
.social-section,
.availability-container,
.contact-info-grid,
.contact-info-item,
.social-links-grid,
.social-link,
.availability-card,
.form-status {
    box-sizing: border-box !important;
}

/* Prevent horizontal scroll on contact page */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }

    #_pages_content {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* iOS Safari specific fixes for contact page */
@supports (-webkit-overflow-scrolling: touch) {
    @media (max-width: 768px) {
        .contact-container {
            -webkit-overflow-scrolling: touch;
        }

        .form-input,
        .form-textarea {
            -webkit-appearance: none !important;
            border-radius: 8px !important;
        }

        .submit-btn {
            -webkit-appearance: none !important;
        }
    }
}

/* Ensure text doesn't break container bounds */
@media (max-width: 768px) {
    .contact-hero-title,
    .contact-hero-subtitle,
    .contact-form-title,
    .contact-form-subtitle,
    .info-section-title,
    .contact-info-title,
    .contact-info-text,
    .contact-info-subtitle,
    .availability-title,
    .availability-text,
    .availability-subtitle {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
}

/* Fix any remaining margin/padding issues */
@media (max-width: 768px) {
    .contact-container * {
        max-width: 100% !important;
    }

    /* Ensure no negative margins */
    .contact-hero,
    .contact-main,
    .contact-form-section,
    .contact-info-section,
    .social-section,
    .availability-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ========================================
   CONTACT PAGE MOBILE BREATHING ROOM & SPACING
   ======================================== */

/* Add proper breathing room for mobile contact elements */
@media (max-width: 768px) {
    /* Main container breathing room */
    .contact-container {
        padding: 15px !important;
        margin: 0 auto !important;
    }

    /* Hero section spacing improvements */
    .contact-hero {
        margin: 0 0 25px 0 !important;
        padding: 35px 20px !important;
    }

    .contact-hero-content {
        padding: 10px !important;
    }

    .contact-hero-title {
        margin-bottom: 18px !important;
    }

    .contact-hero-subtitle {
        margin-bottom: 0 !important;
        padding: 0 10px !important;
    }

    /* Main contact section spacing */
    .contact-main {
        gap: 25px !important;
        margin: 0 0 25px 0 !important;
    }

    /* Form section breathing room */
    .contact-form-section {
        padding: 30px 20px !important;
        margin: 0 0 20px 0 !important;
    }

    .contact-form-title {
        margin-bottom: 12px !important;
    }

    .contact-form-subtitle {
        margin-bottom: 25px !important;
        padding: 0 5px !important;
    }

    /* Form elements spacing */
    .contact-form {
        gap: 22px !important;
    }

    .form-group {
        gap: 8px !important;
        margin-bottom: 5px !important;
    }

    .form-label {
        margin-bottom: 8px !important;
        padding: 0 2px !important;
    }

    .form-input, .form-textarea {
        margin-bottom: 5px !important;
    }

    .form-submit {
        margin-top: 10px !important;
        padding: 0 !important;
    }

    .submit-btn {
        margin: 0 !important;
        padding: 16px 28px !important;
    }

    /* Contact info column spacing */
    .contact-info-column {
        gap: 25px !important;
    }

    /* Info sections breathing room */
    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 25px 20px !important;
        margin: 0 0 20px 0 !important;
    }

    .info-section-title {
        margin-bottom: 18px !important;
        padding: 0 2px !important;
    }

    /* Contact info items spacing */
    .contact-info-grid {
        gap: 18px !important;
    }

    .contact-info-item {
        padding: 16px !important;
        gap: 14px !important;
        margin-bottom: 5px !important;
    }

    .contact-info-content {
        padding: 2px 0 !important;
    }

    .contact-info-title {
        margin-bottom: 6px !important;
    }

    .contact-info-text {
        margin-bottom: 3px !important;
        line-height: 1.4 !important;
    }

    .contact-info-subtitle {
        margin: 0 !important;
        padding-top: 2px !important;
    }

    /* Social links spacing */
    .social-links-grid {
        gap: 15px !important;
        margin-top: 5px !important;
    }

    .social-link {
        padding: 14px 12px !important;
        gap: 12px !important;
        margin: 2px !important;
    }

    /* Availability card spacing */
    .availability-card {
        padding: 18px !important;
        gap: 14px !important;
        margin: 5px 0 !important;
    }

    .availability-content {
        padding: 2px 0 !important;
    }

    .availability-title {
        margin-bottom: 8px !important;
    }

    .availability-text {
        margin-bottom: 5px !important;
        line-height: 1.4 !important;
    }

    .availability-subtitle {
        margin: 0 !important;
        padding-top: 2px !important;
    }

    /* Form status spacing */
    .form-status {
        margin-top: 18px !important;
        padding: 0 !important;
    }

    .form-status.success, .form-status.error {
        padding: 14px 18px !important;
        margin: 15px 0 0 0 !important;
    }

    .status-content {
        gap: 10px !important;
        padding: 2px !important;
    }
}

/* Small mobile enhanced breathing room */
@media (max-width: 480px) {
    .contact-container {
        padding: 12px !important;
    }

    /* Hero enhanced spacing */
    .contact-hero {
        margin: 0 0 20px 0 !important;
        padding: 25px 15px !important;
    }

    .contact-hero-content {
        padding: 8px !important;
    }

    .contact-hero-title {
        margin-bottom: 15px !important;
    }

    .contact-hero-subtitle {
        padding: 0 8px !important;
    }

    /* Main section enhanced spacing */
    .contact-main {
        gap: 20px !important;
        margin: 0 0 20px 0 !important;
    }

    /* Form section enhanced breathing room */
    .contact-form-section {
        padding: 25px 15px !important;
        margin: 0 0 15px 0 !important;
    }

    .contact-form-title {
        margin-bottom: 10px !important;
    }

    .contact-form-subtitle {
        margin-bottom: 20px !important;
        padding: 0 3px !important;
    }

    /* Form elements enhanced spacing */
    .contact-form {
        gap: 20px !important;
    }

    .form-group {
        gap: 7px !important;
        margin-bottom: 3px !important;
    }

    .form-label {
        margin-bottom: 7px !important;
        padding: 0 1px !important;
    }

    .form-input, .form-textarea {
        margin-bottom: 3px !important;
    }

    .form-submit {
        margin-top: 8px !important;
    }

    .submit-btn {
        padding: 14px 24px !important;
    }

    /* Info sections enhanced breathing room */
    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 20px 15px !important;
        margin: 0 0 15px 0 !important;
    }

    .info-section-title {
        margin-bottom: 15px !important;
        padding: 0 1px !important;
    }

    /* Contact info enhanced spacing */
    .contact-info-grid {
        gap: 15px !important;
    }

    .contact-info-item {
        padding: 12px !important;
        gap: 12px !important;
        margin-bottom: 3px !important;
    }

    .contact-info-content {
        padding: 1px 0 !important;
    }

    .contact-info-title {
        margin-bottom: 4px !important;
    }

    .contact-info-text {
        margin-bottom: 2px !important;
        line-height: 1.3 !important;
    }

    .contact-info-subtitle {
        padding-top: 1px !important;
    }

    /* Social links enhanced spacing */
    .social-links-grid {
        gap: 12px !important;
        margin-top: 3px !important;
    }

    .social-link {
        padding: 12px 10px !important;
        gap: 10px !important;
        margin: 1px !important;
    }

    /* Availability enhanced spacing */
    .availability-card {
        padding: 15px !important;
        gap: 12px !important;
        margin: 3px 0 !important;
    }

    .availability-title {
        margin-bottom: 6px !important;
    }

    .availability-text {
        margin-bottom: 3px !important;
        line-height: 1.3 !important;
    }

    .availability-subtitle {
        padding-top: 1px !important;
    }

    /* Form status enhanced spacing */
    .form-status.success, .form-status.error {
        padding: 12px 16px !important;
        margin: 12px 0 0 0 !important;
    }

    .status-content {
        gap: 8px !important;
        padding: 1px !important;
    }
}

/* Extra small mobile maximum breathing room */
@media (max-width: 360px) {
    .contact-container {
        padding: 10px !important;
    }

    /* Hero maximum breathing room */
    .contact-hero {
        margin: 0 0 15px 0 !important;
        padding: 20px 12px !important;
    }

    .contact-hero-content {
        padding: 6px !important;
    }

    .contact-hero-title {
        margin-bottom: 12px !important;
    }

    .contact-hero-subtitle {
        padding: 0 6px !important;
    }

    /* Main section maximum breathing room */
    .contact-main {
        gap: 15px !important;
        margin: 0 0 15px 0 !important;
    }

    /* Form section maximum breathing room */
    .contact-form-section {
        padding: 20px 12px !important;
        margin: 0 0 12px 0 !important;
    }

    .contact-form-title {
        margin-bottom: 8px !important;
    }

    .contact-form-subtitle {
        margin-bottom: 18px !important;
        padding: 0 2px !important;
    }

    /* Form elements maximum spacing */
    .contact-form {
        gap: 18px !important;
    }

    .form-group {
        gap: 6px !important;
        margin-bottom: 2px !important;
    }

    .form-label {
        margin-bottom: 6px !important;
    }

    .form-input, .form-textarea {
        margin-bottom: 2px !important;
    }

    .form-submit {
        margin-top: 6px !important;
    }

    .submit-btn {
        padding: 12px 20px !important;
    }

    /* Info sections maximum breathing room */
    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 18px 12px !important;
        margin: 0 0 12px 0 !important;
    }

    .info-section-title {
        margin-bottom: 12px !important;
    }

    /* Contact info maximum spacing */
    .contact-info-grid {
        gap: 12px !important;
    }

    .contact-info-item {
        padding: 10px !important;
        gap: 10px !important;
        margin-bottom: 2px !important;
    }

    .contact-info-title {
        margin-bottom: 3px !important;
    }

    .contact-info-text {
        margin-bottom: 1px !important;
        line-height: 1.2 !important;
    }

    /* Social links maximum spacing */
    .social-links-grid {
        gap: 10px !important;
        margin-top: 2px !important;
    }

    .social-link {
        padding: 10px 8px !important;
        gap: 8px !important;
        margin: 1px !important;
    }

    /* Availability maximum spacing */
    .availability-card {
        padding: 12px !important;
        gap: 10px !important;
        margin: 2px 0 !important;
    }

    .availability-title {
        margin-bottom: 5px !important;
    }

    .availability-text {
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
    }

    /* Form status maximum spacing */
    .form-status.success, .form-status.error {
        padding: 10px 14px !important;
        margin: 10px 0 0 0 !important;
    }

    .status-content {
        gap: 6px !important;
    }
}

/* Enhanced landscape mobile breathing room */
@media (max-width: 768px) and (orientation: landscape) {
    .contact-hero {
        padding: 25px 20px !important;
        margin: 0 0 20px 0 !important;
    }

    .contact-main {
        gap: 20px !important;
        margin: 0 0 20px 0 !important;
    }

    .contact-form-section {
        padding: 25px 18px !important;
    }

    .contact-info-section,
    .social-section,
    .availability-container {
        padding: 20px 15px !important;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .contact-hero {
        padding: 20px 15px !important;
        margin: 0 0 15px 0 !important;
    }

    .contact-main {
        gap: 15px !important;
        margin: 0 0 15px 0 !important;
    }

    .contact-form-section {
        padding: 20px 15px !important;
    }

    .form-textarea {
        min-height: 60px !important;
    }
}

/* Additional breathing room for touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Enhanced touch spacing */
    .contact-info-item {
        padding: 18px 14px !important;
        margin-bottom: 8px !important;
    }

    .social-link {
        padding: 16px 12px !important;
        margin: 3px 1px !important;
    }

    .form-input, .form-textarea {
        padding: 16px 18px !important;
        margin-bottom: 8px !important;
    }

    .submit-btn {
        padding: 18px 30px !important;
        margin-top: 12px !important;
    }

    .availability-card {
        padding: 20px 16px !important;
        margin: 8px 0 !important;
    }
}

/* Ensure consistent spacing between all contact elements */
@media (max-width: 768px) {
    /* Add consistent vertical rhythm */
    .contact-hero + .contact-main {
        margin-top: 0 !important;
    }

    .contact-form-section + .contact-info-column {
        margin-top: 0 !important;
    }

    .contact-info-section + .social-section {
        margin-top: 0 !important;
    }

    .social-section + .availability-container {
        margin-top: 0 !important;
    }

    /* Enhanced padding for better touch interaction */
    .contact-icon {
        padding: 2px !important;
        margin: 1px !important;
    }

    .social-icon {
        padding: 1px !important;
        margin: 1px !important;
    }

    .status-indicator {
        padding: 2px !important;
        margin: 1px 4px 1px 0 !important;
    }

    /* Better text spacing */
    .contact-hero-title,
    .contact-form-title,
    .info-section-title {
        letter-spacing: 0.3px !important;
        word-spacing: 1px !important;
    }

    .contact-hero-subtitle,
    .contact-form-subtitle {
        letter-spacing: 0.2px !important;
        word-spacing: 0.5px !important;
    }

    .contact-info-text,
    .contact-info-subtitle,
    .availability-text,
    .availability-subtitle {
        letter-spacing: 0.1px !important;
        word-spacing: 0.3px !important;
    }
}

/* ========================================
   CAROUSEL MOBILE OPTIMIZATION FIXES
   ======================================== */

/* Fix carousel navigation button sizing and positioning on mobile */
@media (max-width: 768px) {
    /* Override navigation button positioning to prevent overflow */
    .carousel-navigation {
        padding: 0 10px !important;
        pointer-events: none;
    }

    /* Fix navigation button sizing - remove conflicting min-width/height */
    .carousel-nav {
        width: 40px !important;
        height: 40px !important;
        min-width: auto !important;
        min-height: auto !important;
        font-size: 18px !important;
        border-width: 1px !important;
        margin: 0 !important;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Fix arrow sizing inside nav buttons */
    .nav-arrow {
        font-size: 18px !important;
        line-height: 1 !important;
    }

    /* Fix carousel indicators positioning and sizing */
    .carousel-indicators {
        bottom: 8px !important;
        gap: 6px !important;
        padding: 0 5px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        z-index: 20 !important;
    }

    /* Fix individual indicator sizing */
    .carousel-indicator {
        width: 10px !important;
        height: 10px !important;
        min-width: auto !important;
        min-height: auto !important;
        flex-shrink: 0 !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        border-width: 1px !important;
    }

    /* Fix carousel caption overflow */
    .carousel-caption {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px 10px 8px 10px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        transform: none !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }

    .carousel-caption.active {
        transform: none !important;
    }

    /* Fix caption text sizing and spacing */
    .carousel-caption-title {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .carousel-caption-text {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        text-overflow: ellipsis !important;
    }

    /* Fix custom carousel height and proportions */
    .custom-carousel {
        height: 280px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* Ensure gallery content doesn't overflow */
    .gallery-content {
        padding: 0 5px !important;
        overflow: hidden !important;
    }

    /* CRITICAL FIX: Ensure carousel images are properly displayed on mobile */
    .carousel-image {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        opacity: 0 !important;
        transition: opacity 0.6s ease-in-out !important;
        z-index: 1 !important;
    }

    .carousel-image.active {
        display: block !important;
        opacity: 1 !important;
        z-index: 2 !important;
    }

    /* Fix carousel images container */
    .carousel-images-container {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
}

/* Small mobile devices - more aggressive fixes */
@media (max-width: 480px) {
    .carousel-navigation {
        padding: 0 8px !important;
    }

    .carousel-nav {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        border-width: 1px !important;
    }

    .nav-arrow {
        font-size: 16px !important;
    }

    .carousel-indicators {
        bottom: 6px !important;
        gap: 5px !important;
        padding: 0 3px !important;
    }

    .carousel-indicator {
        width: 8px !important;
        height: 8px !important;
        border-width: 1px !important;
    }

    .carousel-caption {
        padding: 12px 8px 6px 8px !important;
        bottom: 0 !important;
    }

    .carousel-caption-title {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
        line-height: 1.1 !important;
    }

    .carousel-caption-text {
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
    }

    .custom-carousel {
        height: 250px !important;
        border-radius: 10px !important;
    }

    .gallery-content {
        padding: 0 3px !important;
    }

    /* Fix project section padding on mobile */
    .project-section {
        padding: 50px 15px !important;
    }
}

/* Extra small devices - maximum optimization */
@media (max-width: 360px) {
    .carousel-navigation {
        padding: 0 6px !important;
    }

    .carousel-nav {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }

    .nav-arrow {
        font-size: 14px !important;
    }

    .carousel-indicators {
        bottom: 5px !important;
        gap: 4px !important;
        padding: 0 2px !important;
    }

    .carousel-indicator {
        width: 6px !important;
        height: 6px !important;
        border-width: 1px !important;
    }

    .carousel-caption {
        padding: 10px 6px 4px 6px !important;
        bottom: 0 !important;
    }

    .carousel-caption-title {
        font-size: 0.9rem !important;
        margin-bottom: 3px !important;
        line-height: 1.1 !important;
    }

    .carousel-caption-text {
        font-size: 0.75rem !important;
        line-height: 1.1 !important;
    }

    .custom-carousel {
        height: 220px !important;
        border-radius: 8px !important;
    }

    .gallery-content {
        padding: 0 2px !important;
    }

    .project-section {
        padding: 40px 12px !important;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-carousel {
        height: 200px !important;
        max-height: 200px !important;
    }

    .carousel-caption {
        padding: 8px 6px 4px 6px !important;
        bottom: 0 !important;
    }

    .carousel-caption-title {
        font-size: 0.9rem !important;
        margin-bottom: 2px !important;
    }

    .carousel-caption-text {
        font-size: 0.7rem !important;
        line-height: 1.1 !important;
    }

    .carousel-indicators {
        bottom: 4px !important;
    }

    .carousel-nav {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }

    .nav-arrow {
        font-size: 14px !important;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .custom-carousel {
        height: 180px !important;
        max-height: 180px !important;
    }

    .carousel-caption {
        padding: 6px 5px 2px 5px !important;
    }

    .carousel-caption-title {
        font-size: 0.8rem !important;
        margin-bottom: 1px !important;
    }

    .carousel-caption-text {
        font-size: 0.65rem !important;
    }

    .carousel-indicators {
        bottom: 3px !important;
        gap: 3px !important;
    }

    .carousel-indicator {
        width: 5px !important;
        height: 5px !important;
    }

    .carousel-nav {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    .nav-arrow {
        font-size: 12px !important;
    }
}

/* Touch device optimizations - REMOVE problematic min-width/height */
@media (hover: none) and (pointer: coarse) {
    /* Enhanced touch targets while keeping visual size small */
    .carousel-nav {
        position: relative !important;
        z-index: 10 !important;
        /* Remove problematic min-width/height that cause oversized buttons */
        min-width: auto !important;
        min-height: auto !important;
    }

    .carousel-nav::after {
        content: '' !important;
        position: absolute !important;
        top: -10px !important;
        left: -10px !important;
        right: -10px !important;
        bottom: -10px !important;
        z-index: -1 !important;
    }

    .carousel-indicator {
        position: relative !important;
        z-index: 10 !important;
        /* Remove problematic min-width/height that cause oversized indicators */
        min-width: auto !important;
        min-height: auto !important;
    }

    .carousel-indicator::after {
        content: '' !important;
        position: absolute !important;
        top: -15px !important;
        left: -15px !important;
        right: -15px !important;
        bottom: -15px !important;
        z-index: -1 !important;
    }

    /* Remove hover effects on touch devices */
    .carousel-nav:hover {
        transform: none !important;
        background: rgba(15, 23, 42, 0.9) !important;
        border-color: var(--border-primary) !important;
    }

    .carousel-indicator:hover {
        transform: none !important;
        background: rgba(251, 191, 36, 0.3) !important;
        border-color: var(--border-primary) !important;
    }

    /* Enhanced active states for touch */
    .carousel-nav:active {
        background: rgba(15, 23, 42, 0.95) !important;
        border-color: var(--primary-gold) !important;
        transform: scale(0.95) !important;
    }

    .carousel-indicator:active {
        background: rgba(251, 191, 36, 0.6) !important;
        border-color: var(--primary-gold) !important;
        transform: scale(0.9) !important;
    }
}

/* Fix any z-index stacking issues on mobile */
@media (max-width: 768px) {
    .carousel-images-container {
        z-index: 1 !important;
    }

    .carousel-captions {
        z-index: 5 !important;
    }

    .carousel-navigation {
        z-index: 15 !important;
    }

    .carousel-indicators {
        z-index: 20 !important;
    }
}

/* Prevent carousel from breaking layout on very small screens */
@media (max-width: 320px) {
    .custom-carousel {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
        border-radius: 6px !important;
    }

    .gallery-content {
        padding: 0 1px !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .project-section {
        padding: 35px 10px !important;
    }

    .carousel-navigation {
        padding: 0 4px !important;
    }

    .carousel-nav {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        border-width: 1px !important;
    }

    .nav-arrow {
        font-size: 12px !important;
    }

    .carousel-indicators {
        bottom: 4px !important;
        gap: 3px !important;
        padding: 0 1px !important;
    }

    .carousel-indicator {
        width: 5px !important;
        height: 5px !important;
        border-width: 1px !important;
    }

    .carousel-caption {
        padding: 8px 4px 2px 4px !important;
        bottom: 0 !important;
    }

    .carousel-caption-title {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
        line-height: 1.0 !important;
    }

    .carousel-caption-text {
        font-size: 0.7rem !important;
        line-height: 1.0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-overflow-scrolling: touch) {
    @media (max-width: 768px) {
        .custom-carousel {
            -webkit-overflow-scrolling: touch !important;
            transform: translateZ(0) !important;
        }

        .carousel-nav {
            -webkit-appearance: none !important;
            -webkit-tap-highlight-color: transparent !important;
        }

        .carousel-indicator {
            -webkit-appearance: none !important;
            -webkit-tap-highlight-color: transparent !important;
        }

        .carousel-caption {
            -webkit-transform: translateZ(0) !important;
        }
    }
}

/* ========================================
   HERO SECTION GRADIENT BLENDING FIX - SMOOTH TRANSITION
   ======================================== */

/* Hero section with extended padding and seamless gradient */
body .hero-section.hero-section {
    border-radius: 20px 20px 0 0 !important;
    padding: 80px 0 80px 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    z-index: 2 !important;
    background: linear-gradient(135deg, var(--bg-dark) 0%, rgba(15, 23, 42, 0.95) 50%, var(--bg-dark) 100%) !important;
}

/* Create seamless gradient transition from hero to skills */
body .hero-section.hero-section::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 120px !important;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(15, 23, 42, 0.05) 5%,
        rgba(15, 23, 42, 0.1) 10%,
        rgba(15, 23, 42, 0.2) 20%,
        rgba(15, 23, 42, 0.35) 35%,
        rgba(15, 23, 42, 0.5) 50%,
        rgba(15, 23, 42, 0.65) 65%,
        rgba(15, 23, 42, 0.8) 80%,
        rgba(15, 23, 42, 0.9) 90%,
        var(--bg-dark) 100%
    ) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Skills section with perfect alignment and no background conflicts */
body .simple-skills-section.simple-skills-section {
    background: var(--bg-dark) !important;
    border-radius: 0 0 20px 20px !important;
    padding: 120px 0 80px 0 !important;
    margin-top: -120px !important;
    position: relative !important;
    z-index: 1 !important;
    padding-top: 200px !important;
}

/* Remove any conflicting pseudo-elements from skills section */
body .simple-skills-section.simple-skills-section::before {
    display: none !important;
}

/* Ensure skills grid content appears properly */
body .simple-skills-grid {
    position: relative !important;
    z-index: 2 !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body .hero-section.hero-section {
        padding: 60px 0 60px 0 !important;
        border-radius: 16px 16px 0 0 !important;
    }

    body .hero-section.hero-section::after {
        height: 90px !important;
    }

    body .simple-skills-section.simple-skills-section {
        padding-top: 150px !important;
        margin-top: -90px !important;
        border-radius: 0 0 16px 16px !important;
    }
}

@media (max-width: 480px) {
    body .hero-section.hero-section {
        padding: 50px 0 50px 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }

    body .hero-section.hero-section::after {
        height: 70px !important;
    }

    body .simple-skills-section.simple-skills-section {
        padding-top: 120px !important;
        margin-top: -70px !important;
        border-radius: 0 0 12px 12px !important;
    }
}

/* ========================================
   END ENHANCED HERO SECTION GRADIENT BLENDING FIX
   ======================================== */

/* ========================================
   CLICKABLE PROJECT CARD LINK FIXES
   ======================================== */

/* Remove all text decoration and underlines from project card links */
.project-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
    transition: all 0.3s ease !important;
    border: none !important;
    outline: none !important;
}

.project-card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    outline: none !important;
}

.project-card-link:visited {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    outline: none !important;
}

.project-card-link:focus {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    outline: none !important;
}

.project-card-link:active {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    outline: none !important;
}

/* Ensure project card content inherits proper colors */
.project-card-link .project-title {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.project-card-link .project-description {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
}

.project-card-link:hover .project-title {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.project-card-link:hover .project-description {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
}

/* Enhanced Project Preview Cards for Homepage */
.project-preview-card {
    background: var(--bg-card) !important;
    border-radius: 20px !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-medium) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.project-card-link:hover .project-preview-card {
    border-color: var(--border-hover) !important;
    transform: translateY(-8px) !important;
    box-shadow: var(--shadow-heavy) !important;
    text-decoration: none !important;
}

.project-card-link:hover .project-cover-image {
    transform: scale(1.05) !important;
}

/* Project Preview Grid */
.projects-preview-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 30px !important;
    margin-top: 40px !important;
}

/* Remove any browser default link styling */
.project-card-link:-webkit-any-link {
    text-decoration: none !important;
    color: inherit !important;
}

.project-card-link:-moz-any-link {
    text-decoration: none !important;
    color: inherit !important;
}

/* Ensure proper cursor and interaction states */
.project-card-link {
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Remove focus outline but keep accessibility */
.project-card-link:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
}

.project-card-link:focus-visible {
    outline: 2px solid var(--primary-gold) !important;
    outline-offset: 2px !important;
    border-radius: 20px !important;
}

/* Remove any purple/red underlines that might appear */
.project-card-link,
.project-card-link * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    box-shadow: none !important;
}

.project-card-link:hover,
.project-card-link:hover * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
}

/* Ensure tech tags and status badges maintain their styling */
.project-card-link .tech-tag {
    background: rgba(251, 191, 36, 0.15) !important;
    color: var(--primary-gold) !important;
    border: 1px solid var(--border-primary) !important;
    text-decoration: none !important;
}

.project-card-link .status-badge {
    text-decoration: none !important;
}

.project-card-link .status-completed {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    text-decoration: none !important;
}

.project-card-link .status-in-progress {
    background: rgba(251, 146, 60, 0.2) !important;
    color: #fb923c !important;
    border: 1px solid rgba(251, 146, 60, 0.3) !important;
    text-decoration: none !important;
}

/* Mobile responsiveness for clickable cards */
@media (max-width: 768px) {
    .projects-preview-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        max-width: 600px !important;
        margin: 0 auto 40px auto !important;
    }

    .project-card-link {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .project-preview-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Enhanced touch target for mobile */
    .project-card-link {
        min-height: 44px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .project-card-link:active .project-preview-card {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}

@media (max-width: 480px) {
    .projects-preview-grid {
        gap: 20px !important;
        margin-top: 30px !important;
    }

    .project-preview-card {
        border-radius: 16px !important;
    }

    .project-card-link:hover .project-preview-card {
        transform: translateY(-4px) !important;
    }
}

/* ========================================
   END CLICKABLE PROJECT CARD LINK FIXES
   ======================================== */

/* ========================================
   MOBILE STATUS BADGE CENTERING
   ======================================== */

/* Center-align status badges on mobile devices */
@media (max-width: 768px) {
    .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
    }

    /* Ensure status badges are centered in project cards */
    .project-card .status-badge,
    .project-preview-card .status-badge,
    .project-card-content .status-badge,
    .project-content .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
    }

    /* Center status badges in clickable project cards */
    .project-card-link .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
    }

    /* Center status badges in project grid items */
    .project-item .status-badge,
    .finding-item .status-badge,
    .data-item .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
    }

    /* Ensure proper centering in flex containers */
    .project-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .project-header .status-badge {
        align-self: center !important;
        margin-top: 10px !important;
    }
}

/* Small mobile devices - maintain centering */
@media (max-width: 480px) {
    .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    /* Additional centering for very small screens */
    .project-card-content,
    .project-content {
        align-items: center !important;
    }

    .project-card-content .status-badge,
    .project-content .status-badge {
        align-self: center !important;
        margin: 8px auto 0 auto !important;
    }
}

/* Extra small mobile devices - ensure perfect centering */
@media (max-width: 360px) {
    .status-badge {
        align-self: center !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Force center alignment for all status badge containers */
    .project-card-content,
    .project-content,
    .project-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
}

/* ========================================
   END MOBILE STATUS BADGE CENTERING
   ======================================== */

/* ========================================
   CONTACT PAGE IMAGE OVERFLOW FIXES
   ======================================== */

/* Fix contact icon images - prevent overflow */
.contact-icon {
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-hover)) !important;
    border-radius: 12px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.contact-icon img {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    object-position: center !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Fix social media icon images - prevent overflow */
.social-icon {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-hover)) !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.social-icon img {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
    object-position: center !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Fix button icon images - prevent overflow */
.btn-icon {
    width: 16px !important;
    height: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    margin-right: 8px !important;
    box-sizing: border-box !important;
}

.btn-icon img {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
    object-position: center !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: block !important;
    margin: 0 !important;
}

/* Mobile specific icon adjustments */
@media (max-width: 768px) {
    .contact-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 10px !important;
    }

    .contact-icon img {
        width: 16px !important;
        height: 16px !important;
        max-width: 16px !important;
        max-height: 16px !important;
    }

    .social-icon {
        width: 28px !important;
        height: 28px !important;
        border-radius: 6px !important;
    }

    .social-icon img {
        width: 14px !important;
        height: 14px !important;
        max-width: 14px !important;
        max-height: 14px !important;
    }

    .btn-icon {
        width: 14px !important;
        height: 14px !important;
        margin-right: 6px !important;
    }

    .btn-icon img {
        width: 14px !important;
        height: 14px !important;
        max-width: 14px !important;
        max-height: 14px !important;
    }
}

/* Small mobile devices - even smaller icons */
@media (max-width: 480px) {
    .contact-icon {
        width: 28px !important;
        height: 28px !important;
        border-radius: 8px !important;
    }

    .contact-icon img {
        width: 14px !important;
        height: 14px !important;
        max-width: 14px !important;
        max-height: 14px !important;
    }

    .social-icon {
        width: 24px !important;
        height: 24px !important;
        border-radius: 5px !important;
    }

    .social-icon img {
        width: 12px !important;
        height: 12px !important;
        max-width: 12px !important;
        max-height: 12px !important;
    }

    .btn-icon {
        width: 12px !important;
        height: 12px !important;
        margin-right: 5px !important;
    }

    .btn-icon img {
        width: 12px !important;
        height: 12px !important;
        max-width: 12px !important;
        max-height: 12px !important;
    }
}

/* Extra small mobile devices - minimum viable icons */
@media (max-width: 360px) {
    .contact-icon {
        width: 24px !important;
        height: 24px !important;
        border-radius: 6px !important;
    }

    .contact-icon img {
        width: 12px !important;
        height: 12px !important;
        max-width: 12px !important;
        max-height: 12px !important;
    }

    .social-icon {
        width: 20px !important;
        height: 20px !important;
        border-radius: 4px !important;
    }

    .social-icon img {
        width: 10px !important;
        height: 10px !important;
        max-width: 10px !important;
        max-height: 10px !important;
    }

    .btn-icon {
        width: 10px !important;
        height: 10px !important;
        margin-right: 4px !important;
    }

    .btn-icon img {
        width: 10px !important;
        height: 10px !important;
        max-width: 10px !important;
        max-height: 10px !important;
    }
}

/* Ensure all contact page images respect container boundaries */
.contact-container img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
}

/* Prevent any image overflow in contact sections */
.contact-info-item,
.social-link,
.submit-btn {
    overflow: hidden !important;
}

.contact-info-item img,
.social-link img,
.submit-btn img {
    flex-shrink: 0 !important;
}

/* High DPI display optimizations for contact icons */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .contact-icon img,
    .social-icon img,
    .btn-icon img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
}

/* Touch device optimizations for contact icons */
@media (hover: none) and (pointer: coarse) {
    .contact-icon,
    .social-icon {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}

/* ========================================
   END CONTACT PAGE IMAGE OVERFLOW FIXES
   ======================================== */

/* ========================================
   PROJECTS PAGE GRADIENT BLENDING FIX - SMOOTH TRANSITION
   ======================================== */

/* Projects header section with extended padding and seamless gradient */
body .page-header-section.page-header-section {
    border-radius: 20px 20px 0 0 !important;
    padding: 80px 0 80px 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    z-index: 2 !important;
    background: linear-gradient(135deg, var(--bg-dark) 0%, rgba(15, 23, 42, 0.95) 50%, var(--bg-dark) 100%) !important;
}

/* Create seamless gradient transition from projects header to projects grid */
body .page-header-section.page-header-section::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 120px !important;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(15, 23, 42, 0.05) 5%,
        rgba(15, 23, 42, 0.1) 10%,
        rgba(15, 23, 42, 0.2) 20%,
        rgba(15, 23, 42, 0.35) 35%,
        rgba(15, 23, 42, 0.5) 50%,
        rgba(15, 23, 42, 0.65) 65%,
        rgba(15, 23, 42, 0.8) 80%,
        rgba(15, 23, 42, 0.9) 90%,
        var(--bg-dark) 100%
    ) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Projects section with perfect alignment and no background conflicts */
body .projects-section.projects-section {
    background: var(--bg-dark) !important;
    border-radius: 0 0 20px 20px !important;
    padding: 120px 0 80px 0 !important;
    margin-top: -120px !important;
    position: relative !important;
    z-index: 1 !important;
    padding-top: 200px !important;
}

/* Remove any conflicting pseudo-elements from projects section */
body .projects-section.projects-section::before {
    display: none !important;
}

/* Ensure projects grid content appears properly */
body .projects-grid {
    position: relative !important;
    z-index: 2 !important;
}

/* Mobile responsive adjustments for projects page */
@media (max-width: 768px) {
    body .page-header-section.page-header-section {
        padding: 60px 0 60px 0 !important;
        border-radius: 16px 16px 0 0 !important;
    }

    body .page-header-section.page-header-section::after {
        height: 90px !important;
    }

    body .projects-section.projects-section {
        padding-top: 150px !important;
        margin-top: -90px !important;
        border-radius: 0 0 16px 16px !important;
    }
}

@media (max-width: 480px) {
    body .page-header-section.page-header-section {
        padding: 50px 0 50px 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }

    body .page-header-section.page-header-section::after {
        height: 70px !important;
    }

    body .projects-section.projects-section {
        padding-top: 120px !important;
        margin-top: -70px !important;
        border-radius: 0 0 12px 12px !important;
    }
}

/* ========================================
   END PROJECTS PAGE GRADIENT BLENDING FIX - SMOOTH TRANSITION
   ======================================== */
