/* ===================================
   MODERN PORTFOLIO MODAL - COMPLETE REDESIGN
   Glassmorphism + Neumorphism + Advanced Animations
   =================================== */

/* ===================================
   MODAL BASE & OVERLAY
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    animation: overlayFadeIn 0.5s ease-out;
    z-index: 1;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px) saturate(180%);
    }
}

/* ===================================
   MODAL CONTENT CONTAINER
   =================================== */
.modal-content {
    position: relative;
    width: min(1400px, 95vw);
    max-height: 90vh;
    margin: auto;
    background: linear-gradient(145deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(30, 41, 59, 0.92) 50%,
        rgba(15, 23, 42, 0.95) 100%);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.8),
        0 20px 60px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 2;
    animation: modalSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================
   ANIMATED BACKGROUND EFFECTS
   =================================== */
.modal-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.modal-orb-1,
.modal-orb-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 12s ease-in-out infinite;
}

.modal-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.modal-orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-delay: 2s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(at 20% 30%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
    opacity: 0.8;
    animation: meshPulse 8s ease-in-out infinite;
}

@keyframes meshPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

/* ===================================
   CLOSE BUTTON
   =================================== */
.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-primary, #fff);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    border-color: rgba(239, 68, 68, 0.5);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ===================================
   MODAL BODY LAYOUT
   =================================== */
.modal-body {
    position: relative;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    padding: 32px;
    height: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.8), rgba(168, 85, 247, 0.8));
}

/* ===================================
   GALLERY SECTION (LEFT SIDE - 60%)
   =================================== */
.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.gallery-main {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media Info Bar */
.media-info-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.9);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    letter-spacing: 0.5px;
    z-index: 10;
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: infoBarSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes infoBarSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.media-divider {
    color: rgba(99, 102, 241, 0.6);
    font-size: 12px;
}

/* Media Frame */
.media-frame {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.media-frame img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: imageZoomIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.media-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 16px;
}

.media-placeholder i {
    font-size: 64px;
    color: rgba(99, 102, 241, 0.4);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Video Wrapper */
.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 16px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: black;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Gallery Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-primary, #fff);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-nav:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

.gallery-nav.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Thumbnails Carousel */
.gallery-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
    border-radius: 10px;
}

.gallery-thumbnails.is-hidden {
    display: none;
}

.thumbnail {
    flex: 0 0 140px;
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    scroll-snap-align: start;
}

.thumbnail:hover {
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.thumbnail.active {
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.video-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-primary, #fff);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.3));
    font-size: 12px;
}

.thumbnail .play-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.thumbnail.video-thumb:hover .play-icon {
    background: rgba(99, 102, 241, 0.8);
    transform: scale(1.1);
}

/* ===================================
   DETAILS SECTION (RIGHT SIDE - 40%)
   =================================== */
.modal-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-right: 8px;
}

.modal-details::-webkit-scrollbar {
    width: 6px;
}

.modal-details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-details::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
    border-radius: 10px;
}

/* Header Section */
.modal-header {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
}

.badge-category {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    color: rgba(167, 139, 250, 1);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-status {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    color: rgba(52, 211, 153, 1);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-status.status-draft {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(239, 68, 68, 0.2));
    color: rgba(248, 113, 113, 1);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.modal-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    color: var(--text-primary, #fff);
    margin: 0 0 12px 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, rgba(167, 139, 250, 1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    color: rgba(226, 232, 240, 0.8);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-interactive {
    cursor: pointer;
    border: none;
    outline: none;
}

.stat-card-interactive:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 32px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(99, 102, 241, 0.3);
}

.stat-card-interactive:active {
    transform: translateY(-1px) scale(0.99);
}

.stat-card-interactive.liked {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.15));
    border-color: rgba(239, 68, 68, 0.5);
}

.stat-card-interactive.just-liked {
    animation: statCardPop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes statCardPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.08);
    }
    70% {
        transform: scale(0.96);
    }
    100% {
        transform: scale(1);
    }
}

.stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 16px;
    color: rgba(167, 139, 250, 1);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(4deg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
}

.stat-card-interactive.liked .stat-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.3));
    border-color: rgba(239, 68, 68, 0.5);
    color: rgba(248, 113, 113, 1);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    align-items: flex-start;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(226, 232, 240, 0.6);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    letter-spacing: -0.15px;
}

.stat-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Detail Sections */
.detail-section {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.6), rgba(30, 41, 59, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
    transition: all 0.3s ease;
}

.detail-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header i {
    font-size: 20px;
    color: rgba(167, 139, 250, 1);
}

.section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0;
}

/* Tech Stack Grid */
.tech-stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(167, 139, 250, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.tech-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

/* Features List */
.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.features-list li:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateX(4px);
}

.feature-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: rgba(52, 211, 153, 1);
    font-size: 12px;
}

.features-list li span:last-child {
    color: rgba(226, 232, 240, 0.9);
    font-size: 15px;
    line-height: 1.6;
}

/* Action Buttons */
.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.btn-modern {
    position: relative;
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: none;
    outline: none;
    cursor: pointer;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 1), rgba(168, 85, 247, 1));
    color: #fff;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 48px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-secondary {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, rgba(30, 41, 59, 1), rgba(51, 65, 85, 1));
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.btn-secondary:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.btn-modern:hover .btn-icon {
    transform: scale(1.2) rotate(5deg);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-modern:hover .btn-shine {
    left: 100%;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Large Tablets - 1024px */
@media (max-width: 1024px) {
    .modal-content {
        width: 95vw;
        max-height: 92vh;
    }

    .modal-body {
        grid-template-columns: 1.2fr 1fr;
        gap: 24px;
        padding: 24px;
    }

    .gallery-main {
        min-height: 400px;
    }

    .modal-title {
        font-size: clamp(24px, 3.5vw, 32px);
    }
}

/* Tablets - 768px */
@media (max-width: 768px) {
    .modal {
        padding: clamp(12px, 4vw, 24px);
        align-items: flex-start;
        justify-content: stretch;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        width: 100%;
        max-height: none;
        min-height: auto;
        border-radius: 24px;
        margin: 0;
        overflow: visible;
        box-shadow: 0 30px 60px rgba(3, 4, 15, 0.65);
    }

    .modal-body {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: clamp(18px, 4vw, 28px);
        max-height: none;
        overflow: visible;
    }

    .modal-gallery,
    .modal-details {
        width: 100%;
    }

    .modal-details {
        padding-bottom: 8px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
        top: 16px;
        right: 16px;
    }

    .gallery-main {
        min-height: 320px;
    }

    .media-frame {
        min-height: 320px;
    }

    .gallery-thumbnails {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 16px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-modern {
        width: 100%;
        min-width: auto;
    }

    .modal-orb-1,
    .modal-orb-2 {
        width: 300px;
        height: 300px;
    }

    .stat-card {
        padding: 18px 20px;
    }
}

/* Mobile - 640px */
@media (max-width: 640px) {
    .modal-content {
        border-radius: 20px;
    }

    .modal-body {
        padding: 16px;
        gap: 20px;
    }

    .modal-gallery {
        order: 1;
    }

    .modal-details {
        order: 2;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
        font-size: 18px;
    }

    .gallery-main {
        min-height: 280px;
        border-radius: 16px;
    }

    .media-frame {
        min-height: 280px;
        padding: 12px;
    }

    .media-info-bar {
        font-size: 12px;
        padding: 8px 16px;
        top: 12px;
        display: none;
    }

    .gallery-nav {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .gallery-nav.prev {
        left: 12px;
    }

    .gallery-nav.next {
        right: 12px;
    }

    .thumbnail {
        flex: 0 0 92px;
        width: 92px;
        height: 58px;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-subtitle {
        font-size: 14px;
    }

    .stat-card {
        padding: 16px 18px;
        min-height: 72px;
        gap: 10px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 22px;
    }

    .detail-section {
        padding: 20px;
    }

    .section-header h3 {
        font-size: 16px;
    }

    .tech-badge {
        padding: 8px 14px;
        font-size: 13px;
    }

    .features-list li {
        padding: 10px;
    }

    .btn-modern {
        padding: 14px 24px;
        font-size: 14px;
    }

    .modal-orb-1,
    .modal-orb-2 {
        width: 250px;
        height: 250px;
        filter: blur(60px);
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-body {
        padding: 12px;
    }

    .gallery-main {
        min-height: 240px;
    }

    .media-frame {
        min-height: 240px;
    }

    .modal-badges {
        gap: 8px;
    }

    .badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .modal-title {
        font-size: 20px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        gap: 12px;
    }

    .thumbnail {
        flex: 0 0 80px;
        width: 80px;
        height: 50px;
    }
}

/* ===================================
   LOADING & DISABLED STATES
   =================================== */
.stat-card-interactive.loading {
    opacity: 0.6;
    pointer-events: none;
}

.stat-card-interactive.loading .stat-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes rippleEffect {
    0% {
        background: radial-gradient(circle at center, rgba(99, 102, 241, 0.4) 0%, transparent 0%);
    }
    50% {
        background: radial-gradient(circle at center, rgba(99, 102, 241, 0.2) 50%, transparent 50%);
    }
    100% {
        background: radial-gradient(circle at center, rgba(99, 102, 241, 0) 100%, transparent 100%);
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.modal-close:focus-visible,
.gallery-nav:focus-visible,
.btn-modern:focus-visible,
.stat-card-interactive:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}
