﻿/* ===== Device Frames CSS ===== */

/* Container for devices showcase */
.devices-showcase {
    display: flex;
    gap: var(--spacing-xl);
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: var(--spacing-lg) 0;
    margin: var(--spacing-lg) 0;
}

/* Device wrapper with model selector */
.device-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

/* Model selector */
.device-model-selector {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.model-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.model-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.model-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 500;
}

/* Base device frame */
.device-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== iPhone Base ===== */
.device-iphone {
    width: 340px;
    height: 730px;
    background: #1f1f1f;
    border-radius: 55px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #2c2c2c,
        0 0 0 4px #1a1a1a,
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 6px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* iPhone 11/12/13 - Notch */
.device-iphone.model-notch::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #1f1f1f;
    border-radius: 0 0 20px 20px;
    z-index: 10;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.device-iphone.model-notch::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 11;
}

/* iPhone 14 Pro+ - Dynamic Island */
.device-iphone.model-dynamic-island::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background: #000;
    border-radius: 18px;
    z-index: 10;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Camera and sensor in Dynamic Island */
.device-iphone.model-dynamic-island::after {
    content: '';
    position: absolute;
    top: 29px;
    left: 50%;
    transform: translateX(-24px);
    width: 8px;
    height: 8px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 11;
    box-shadow: 22px 0 0 6px #0a0a0a;
}

/* iPhone screen */
.device-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 45px;
    overflow: hidden;
    position: relative;
}

/* Content inside screen */
.device-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* For iframe */
.device-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
}

/* For image */
.device-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* For video */
.device-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Loading placeholder */
.device-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

/* ===== Android Phone Base ===== */
.device-android {
    width: 320px;
    height: 667px;
    background: #2a2a2a;
    border-radius: 45px;
    padding: 14px;
    box-shadow:
        0 0 0 3px #3a3a3a,
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 6px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Samsung (Punch-hole camera top center) */
.device-android.model-samsung::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 2px #1a1a1a;
}

/* Pixel (Punch-hole camera top left) */
.device-android.model-pixel::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 2px #1a1a1a;
}

/* Xiaomi (Teardrop notch) */
.device-android.model-xiaomi::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 2px #1a1a1a;
}

/* OnePlus (Punch-hole camera top right) */
.device-android.model-oneplus::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 30px;
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 2px #1a1a1a;
}

.device-android .device-screen {
    border-radius: 35px;
}

/* ===== iPad / Tablet ===== */
.device-tablet {
    width: 540px;
    height: 720px;
    background: #2c2c2c;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 0 0 3px #3c3c3c,
        0 25px 80px rgba(0, 0, 0, 0.5),
        inset 0 0 8px rgba(255, 255, 255, 0.1);
    position: relative;
}

.device-tablet .device-screen {
    border-radius: 25px;
}

/* ===== Desktop Browser ===== */
.device-browser {
    width: 1200px;
    max-width: 100%;
    height: auto;
    background: #000;
    border-radius: 8px 8px 0 0;
    box-shadow:
        0 0 0 1px #d0d0d0,
        0 30px 90px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Browser chrome */
.browser-chrome {
    height: 40px;
    min-height: 40px;
    background: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
    display: grid !important;
    grid-template-columns: auto auto 1fr auto !important;
    align-items: center;
    padding: 0 !important;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
}

/* Traffic lights (macOS style) */
.browser-dots {
    display: flex;
    gap: 8px;
    padding-left: 12px;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.browser-dot:nth-child(1) {
    background: #ff5f56;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.1);
}
.browser-dot:nth-child(2) {
    background: #ffbd2e;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.1);
}
.browser-dot:nth-child(3) {
    background: #27c93f;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Navigation buttons */
.browser-nav-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.browser-nav-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browser-nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Address bar */
.browser-address {
    flex: 1;
    min-width: 0;
    height: 26px;
    background: white;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    padding: 0 10px;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.browser-address span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.browser-lock-icon {
    font-size: 12px;
    color: #999;
}

/* Browser actions (right side buttons) */
.browser-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.browser-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browser-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Menu button */
.browser-menu {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.browser-menu:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.device-browser .device-screen {
    flex: 1;
    border-radius: 0;
    background: #000;
    width: 100%;
    height: auto;
}

/* Browser demo screen - desktop */
.browser-demo-screen {
    height: 600px;
}

.browser-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ===== Device Labels ===== */
.device-label {
    margin-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

/* ===== Hover Effects ===== */
.device-frame:hover {
    transform: translateY(-8px);
    transition: transform 0.3s ease;
}

.device-frame:hover .device-screen {
    box-shadow: 0 0 20px rgba(var(--accent), 0.3);
}

/* ===== Animations ===== */
@keyframes deviceSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.device-frame {
    animation: deviceSlideUp 0.6s ease forwards;
}

.device-frame:nth-child(1) { animation-delay: 0s; }
.device-frame:nth-child(2) { animation-delay: 0.1s; }
.device-frame:nth-child(3) { animation-delay: 0.2s; }

/* ===== Responsive ===== */
/* Large Desktop (1600px+) - Browser even wider */
@media (min-width: 1600px) {
    .device-browser {
        width: 1400px;
        max-width: 100%;
        height: 800px;
    }

    .device-iphone,
    .device-android {
        transform: scale(1.1);
    }

    .device-tablet {
        transform: scale(1.05);
    }
}

/* Desktop (1200px to 1599px) - Default large size */
@media (min-width: 1200px) and (max-width: 1599px) {
    .device-browser {
        width: 1200px;
        max-width: 100%;
        height: 700px;
    }

    .device-iphone,
    .device-android {
        transform: scale(1.05);
    }
}

/* Medium screens (769px to 1199px) - Medium size */
@media (min-width: 769px) and (max-width: 1199px) {
    .device-browser {
        width: 100%;
        max-width: 100%;
        height: 550px;
    }

    .device-wrapper {
        max-width: 100%;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .devices-showcase {
        gap: var(--spacing-xl);
        padding: var(--spacing-md) 0;
    }

    .device-wrapper {
        gap: var(--spacing-sm);
        max-width: 100%;
    }

    .device-frame {
        transform: scale(0.9);
    }

    .device-frame:hover {
        transform: scale(0.9) translateY(-8px);
    }

    .device-iphone {
        width: 320px;
        height: 656px;
    }

    .device-android {
        width: 310px;
        height: 626px;
    }

    .device-browser {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        transform: scale(1) !important;
    }

    .browser-demo-screen {
        height: 250px !important;
        width: 100% !important;
    }

    .browser-chrome {
        width: 100% !important;
    }

    .browser-video {
        object-fit: cover !important;
        object-position: center !important;
        width: 101% !important;
        height: 101% !important;
    }

    .device-tablet {
        width: 95%;
        max-width: 480px;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    .device-tablet .device-screen {
        height: 100%;
    }

    .device-label {
        font-size: 0.85rem;
    }

    .device-model-selector {
        gap: 8px;
    }

    .model-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .devices-showcase {
        flex-direction: column;
        gap: var(--spacing-xl);
        padding: var(--spacing-sm) 0;
    }

    .device-wrapper {
        width: 100%;
        gap: var(--spacing-sm);
    }

    .device-frame {
        transform: scale(0.75);
        transform-origin: center center;
    }

    .device-frame:hover {
        transform: scale(0.75) translateY(-8px);
    }

    .device-iphone {
        width: 300px;
        height: 616px;
    }

    .device-android {
        width: 285px;
        height: 586px;
    }

    .device-browser {
        width: 100% !important;
        height: auto !important;
    }

    .browser-demo-screen {
        height: 200px !important;
    }

    .browser-video {
        object-fit: cover !important;
        object-position: center !important;
        width: 101% !important;
        height: 101% !important;
    }

    .device-browser {
        height: 400px;
    }

    .device-tablet {
        width: 90%;
        max-width: 400px;
        height: auto;
        aspect-ratio: 3 / 4;
        transform: scale(1);
    }

    .device-tablet:hover {
        transform: scale(1) translateY(-8px);
    }

    .device-tablet .device-screen {
        height: 100%;
    }

    .device-label {
        font-size: 0.8rem;
    }

    .device-model-selector {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .model-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Smaller Dynamic Island on mobile */
    .device-iphone.model-dynamic-island::before {
        width: 85px;
        height: 24px;
        top: 16px;
        border-radius: 16px;
    }

    .device-iphone.model-dynamic-island::after {
        top: 24px;
        transform: translateX(-20px);
        width: 6px;
        height: 6px;
        box-shadow: 18px 0 0 4px #0a0a0a;
    }

    /* Smaller notch on mobile */
    .device-iphone.model-notch::before {
        width: 100px;
        height: 26px;
        top: 10px;
    }

    .device-iphone.model-notch::after {
        top: 17px;
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 360px) {
    .device-frame {
        transform: scale(0.65);
    }

    .device-frame:hover {
        transform: scale(0.65) translateY(-8px);
    }

    .device-iphone,
    .device-android {
        width: 280px;
        height: 545px;
    }

    .device-browser {
        height: 350px;
    }

    .device-tablet {
        width: 95%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 3 / 4;
        transform: scale(1);
    }

    .device-tablet:hover {
        transform: scale(1) translateY(-6px);
    }

    .model-btn {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
}

/* ===== Comparison View (Side by Side) ===== */
.device-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-lg) 0;
}

.device-comparison .device-frame {
    margin: 0 auto;
}

/* ===== Gallery Slider for Screenshots ===== */
.device-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Swipe hint */
.swipe-hint {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 15;
    animation: swipeHintPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.swipe-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.swipe-text {
    font-size: 11px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

@keyframes swipeHintPulse {
    0%, 100% {
        opacity: 0.8;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) translateX(-5px);
    }
}

/* Hide swipe hint after interaction */
.device-gallery.swiped .swipe-hint {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-gallery .device-content {
    display: flex;
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
}

.device-gallery-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-gallery-slide img,
.device-gallery-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* OLD STRUCTURE: gallery-track + gallery-slide (для BEEF и других старых кейсов) */
.gallery-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
}

.gallery-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.gallery-slide img,
.gallery-slide video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* Gallery controls */
.gallery-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

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

.gallery-dot.active {
    background: white;
    transform: scale(1.3);
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
}

.gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow-left { left: 10px; }
.gallery-arrow-right { right: 10px; }

/* ===== Dark Mode for Devices ===== */
[data-theme="dark"] .device-browser {
    background: #2a2a2a;
}

[data-theme="dark"] .browser-chrome {
    background: #1a1a1a;
    border-bottom-color: #0a0a0a;
}

[data-theme="dark"] .browser-address {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #aaa;
}
