/**
 * Home Page Specific Styles
 * Enhancements for featured files display on the home page
 * Theme: Black and White with Teal Accent (#00d1b8)
 */

/* ===== APP CARD STYLES ===== */

@media (max-width: 640px) {
    .app-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-radius: 16px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .app-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    
    .mobile-app-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
        padding: 0 8px;
    }
    
    .mobile-app-icon {
        margin: 0 auto;
        margin-bottom: 12px;
    }
    
    .btn-touch {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* ===== VIEW TRANSITIONS ===== */

/* Transition animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

@keyframes slide-from-right {
    from {
        transform: translateX(30px);
    }
}

@keyframes slide-to-left {
    to {
        transform: translateX(-30px);
    }
}

/* Product container transitions */
.products-container {
    view-transition-name: products-container;
}

::view-transition-old(products-container),
::view-transition-new(products-container) {
    animation: 90ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
            300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;
    mix-blend-mode: normal;
}

/* Loading state transitions */
.loading-state {
    view-transition-name: loading-state;
}

::view-transition-old(loading-state),
::view-transition-new(loading-state) {
    animation: none;
    mix-blend-mode: normal;
}

/* Preview modal transitions */
.preview-modal {
    view-transition-name: preview-modal;
}

.preview-content {
    view-transition-name: preview-content;
}

::view-transition-old(preview-modal),
::view-transition-new(preview-modal) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(preview-content),
::view-transition-new(preview-content) {
    animation: none;
    mix-blend-mode: normal;
}

/* ===== UTILITY CLASSES ===== */

/* Mobile-specific scrollbar hiding */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ===== ANIMATIONS ===== */

/* Enhanced fade in with upward motion */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FILE FEEDBACK METRICS ===== */

/* Feedback metrics container styling */
.file-feedback-metrics {
    padding: 6px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin: 6px 0;
}

.file-feedback-metrics button {
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.file-feedback-metrics button:hover {
    background: rgba(0, 209, 184, 0.08);
}

.file-feedback-metrics button:active {
    transform: scale(0.95);
}

.file-feedback-metrics .like-btn:hover {
    background: rgba(0, 209, 184, 0.1);
    color: #00d1b8 !important;
}

.file-feedback-metrics .dislike-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444 !important;
}

/* Material Icons styling for feedback buttons */
.file-feedback-metrics .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.file-feedback-metrics button:hover .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* ===== FILE META IMPROVEMENTS ===== */

.file-meta {
    background: #f9fafb;
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
}

.file-meta-separator {
    color: #d1d5db;
    margin: 0 4px;
}

/* ===== ACCESSIBILITY ===== */

/* Focus management for keyboard navigation */
.file-card:focus-visible {
    outline: 3px solid #00d1b8;
    outline-offset: 3px;
}

.action-btn:focus-visible {
    outline: 3px solid #00d1b8;
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */

@media (prefers-contrast: high) {
    .file-card {
        border-width: 2px;
    }
    
    .download-btn,
    .convert-3d-btn {
        border: 2px solid #00d1b8;
    }
    
    .open-btn,
    .remix-btn {
        border-width: 3px;
    }
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 640px) {
    /* Footer spacing to account for mobile navigation */
    main {
        padding-bottom: 70px;
    }
    
    .file-feedback-metrics {
        font-size: 13px;
    }
    
    .file-meta {
        padding: 6px 10px;
    }
}

/* ===== TABLET RESPONSIVE ===== */

@media (min-width: 641px) and (max-width: 1023px) {
    .featured-header {
        gap: 20px;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    #featured-products-section {
        break-inside: avoid;
    }
    
    .file-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    /* Hide interactive elements when printing */
    .file-feedback-metrics,
    .card-actions {
        display: none !important;
    }
}

/* ===== IMAGE PREVIEW IN MESSAGES ===== */
.image-preview-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.image-preview-container:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
}

.image-preview-container img {
    display: block;
    transition: opacity 0.3s ease;
}

.image-preview-container img:hover {
    opacity: 0.9;
}

/* Responsive image preview */
@media (max-width: 640px) {
    .image-preview-container img {
        max-height: 120px !important;
    }
}

