/**
 * PLC-Inspector Website - Custom Styles
 * Supplements Tailwind CSS
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navigation backdrop blur fallback */
@supports not (backdrop-filter: blur(8px)) {
    nav {
        background-color: rgba(255, 255, 255, 0.98) !important;
    }
}

/* Screenshot hover effect */
.screenshot-container img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-container img:hover {
    transform: scale(1.02);
}

/* Crop gray border from macOS window screenshots (for screenshots section) */
.screenshot-crop {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: white;
}

.screenshot-crop img {
    /* Scale up to crop the gray border, shift up to hide bottom border */
    transform: scale(1.12) translateY(-2%);
    transform-origin: center top;
    display: block;
    background: white;
}

/* Feature card hover effect */
.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Button hover effects */
.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

/* Language dropdown animation */
#langDropdown {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top right;
}

#langDropdown.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

#langDropdown:not(.hidden) {
    opacity: 1;
    transform: scale(1);
}

/* Mobile menu animation */
#mobileMenu {
    transition: max-height 0.3s ease;
}

/* Hero section gradient animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* App Store badge hover effect */
a img[alt*="App Store"] {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover img[alt*="App Store"] {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Focus states for accessibility */
a:focus,
button:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav,
    #langDropdown,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Device showcase section */
.device-showcase {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.device-image {
    flex-shrink: 0;
}

.device-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Device sizes */
.device-mac img {
    max-height: 400px;
}

.device-ipad img {
    max-height: 320px;
}

.device-iphone img {
    max-height: 380px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .device-mac img {
        max-height: 320px;
    }
    .device-ipad img {
        max-height: 260px;
    }
    .device-iphone img {
        max-height: 300px;
    }
}

@media (max-width: 900px) {
    .device-showcase {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .device-mac img {
        max-height: 280px;
    }
    .device-ipad img {
        max-height: 240px;
    }
    .device-iphone img {
        max-height: 320px;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    body {
        background-color: #1D1D1F;
        color: #ffffff;
    }
    */
}
