/**
 * @fileoverview Slide Presentation Styles for Chahua Web Store
 * @description Interactive slide presentation interface with sidebar navigation and content display
 * @dependencies 
 *   - global.css (CSS variables and theme colors)
 * @features
 *   - Slide presentation layout with sidebar
 *   - Interactive slide navigation
 *   - Background grid pattern matching site theme
 *   - Responsive presentation design
 *   - Slide content display area
 * @layout
 *   - Sidebar: Slide navigation and thumbnails
 *   - Main Area: Current slide content display
 *   - Grid Background: Consistent with site design
 * @performance 
 *   - Optimized for presentation navigation
 *   - Smooth slide transitions
 *   - Efficient content loading
 * @calledBy Presentation pages, demo interfaces
 * @example
 * // Slide presentation structure:
 * <div class="slide-presentation-container">
 *   <div class="slides-sidebar">Slide List</div>
 *   <div class="slide-content">Current Slide</div>
 * </div>
 */

/* 
=========================================
Slide Presentation CSS
สีธีมเดียวกับ global.css - ห้ามใช้สีอื่น
=========================================
*/

/* Main Container */
.slide-presentation-container {
    display: flex;
    min-height: calc(100vh - 140px);
    background: var(--bg-primary);
    position: relative;
}

/* Background Grid Pattern (เหมือนหน้าหลัก) */
.slide-presentation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
    z-index: 0;
}

/* ===========================
   SIDEBAR (Slides List)
   =========================== */
.slides-sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.sidebar-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.slides-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Slide Thumbnail Card */
.slide-thumbnail {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.slide-thumbnail:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    transform: translateX(5px);
}

.slide-thumbnail.active {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.slide-thumbnail.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent-blue);
    border-radius: 2px;
}

.slide-thumbnail img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
    border: 1px solid var(--border-color);
}

.slide-thumbnail h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.slide-thumbnail p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===========================
   MAIN SLIDE AREA
   =========================== */
.main-slide-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--gradient-primary);
    z-index: 1;
}

/* Navigation Arrows */
.slide-navigation {
    position: absolute;
    top: 50%;
    left: 2rem;
    right: 2rem;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.nav-arrow {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 170, 255, 0.8);
    border: 2px solid var(--accent-blue);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.nav-arrow:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Main Slide Content */
.slide-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    overflow-y: auto;
    min-height: 0;
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Plugin Slide Wrapper */
.plugin-slide {
    max-width: 800px;
    width: 100%;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin: auto;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Slide Title */
.slide-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px var(--shadow-color);
}

/* Price Tags */
.slide-price {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.free-tag,
.price-tag,
.coming-soon-tag {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.free-tag {
    background: var(--success-green);
    color: white;
}

.price-tag {
    background: var(--accent-blue);
    color: white;
}

.coming-soon-tag {
    background: var(--warning-orange);
    color: white;
}

/* Slide Image */
.slide-image {
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.slide-image img {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.slide-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px var(--shadow-color);
    border-color: var(--accent-blue);
}

/* Slide Description */
.slide-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* Loading, Empty, and Error States */
.loading-slide,
.empty-slide,
.error-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 2rem;
    text-align: center;
}

.empty-slide h2,
.error-slide h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.empty-slide p,
.error-slide p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Plugin Slide Content */
.plugin-slide {
    max-width: 900px;
    width: 100%;
    padding: 1rem 0;
    max-height: none;
}

.slide-title {
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slide-price {
    font-size: 1.5rem;
    color: var(--accent-blue);
    font-weight: bold;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.price-tag {
    background: var(--accent-blue);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1.2rem;
}

.free-tag {
    background: var(--success-color);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1.2rem;
}

.coming-soon-tag {
    background: var(--warning-color);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1.2rem;
}

.slide-image {
    margin-bottom: 2rem;
    position: relative;
}

.slide-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    filter: drop-shadow(0 10px 20px rgba(0, 170, 255, 0.3));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.slide-image img:hover {
    transform: scale(1.02);
}

.slide-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Plugin Meta Information */
.plugin-meta {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    text-align: left;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.meta-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.meta-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Star Rating */
.star-rating,
.meta-star-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.meta-star-rating {
    margin: 0.5rem 0;
    flex-direction: column;
    gap: 0.25rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: var(--border-color);
    font-size: 1.2rem;
}

.star.filled {
    color: #ffd700;
}

.star.half {
    color: #ffd700;
}

.rating-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.meta-star-rating .rating-text {
    margin-left: 0;
    font-size: 0.8rem;
    text-align: center;
}

.popularity-score {
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.slide-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.feature-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

/* Plugin Meta Information */
.plugin-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.meta-item {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.meta-item:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.meta-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.meta-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Star Rating in Meta */
.meta-star-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-star-rating .stars {
    display: flex;
    gap: 0.25rem;
}

.meta-star-rating .star {
    font-size: 1.2rem;
    color: #ddd;
    transition: color 0.3s ease;
}

.meta-star-rating .star.filled {
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.meta-star-rating .star.half {
    color: #ffd700;
    opacity: 0.6;
}

.meta-star-rating .rating-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.popularity-score {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 600;
    background: rgba(0, 170, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
}

.slide-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-download,
.btn-purchase,
.btn-forum {
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px solid var(--accent-blue);
    background: var(--accent-blue);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    min-width: 150px;
}

.btn-download:hover,
.btn-purchase:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-forum {
    background: transparent;
    color: var(--accent-blue);
}

.btn-forum:hover {
    background: var(--accent-blue);
    color: var(--text-primary);
}

.btn-download:disabled,
.btn-purchase:disabled {
    background: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   PROGRESS BAR
   =========================== */
.slide-progress {
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: var(--progress, 0%);
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 60px;
    text-align: right;
}

/* ===========================
   RESPONSIVE DESIGN - IMPROVED
   =========================== */
@media (max-width: 768px) {
    .slide-presentation-container {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
    }
    
    /* ===== MOBILE SIDEBAR ===== */
    .slides-sidebar {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        order: 2; /* ย้าย sidebar ลงล่าง */
    }
    
    .sidebar-header {
        display: none; /* ซ่อน header บนมือถือ */
    }
    
    .slides-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 1rem 0.5rem;
        gap: 0.75rem;
        height: 100%;
        align-items: center;
        
        /* Custom scrollbar for mobile */
        scrollbar-width: thin;
        scrollbar-color: var(--accent-blue) transparent;
    }
    
    .slides-list::-webkit-scrollbar {
        height: 4px;
    }
    
    .slides-list::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .slides-list::-webkit-scrollbar-thumb {
        background: var(--accent-blue);
        border-radius: 2px;
    }
    
    .slide-thumbnail {
        min-width: 160px;
        max-width: 160px;
        height: 80px;
        margin-bottom: 0;
        flex-shrink: 0;
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .slide-thumbnail img {
        width: 40px;
        height: 40px;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .slide-thumbnail h4 {
        font-size: 0.8rem;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
    }
    
    .slide-thumbnail p {
        display: none; /* ซ่อนหมวดหมู่บนมือถือ */
    }
    
    /* ===== MOBILE MAIN CONTENT ===== */
    .main-slide-area {
        order: 1; /* ย้าย content ขึ้นบน */
        flex: 1;
    }
    
    .slide-content {
        padding: 1rem 0.75rem;
        overflow-y: auto;
        align-items: flex-start;
        min-height: calc(100vh - 200px); /* พื้นที่สำหรับ sidebar */
    }
    
    .plugin-slide {
        max-width: 100%;
        padding: 0;
        width: 100%;
    }
    
/* ===== MOBILE TEXT SIZES ===== */
    .slide-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .slide-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        text-align: left;
        padding: 0 0.5rem;
        max-height: none;
        overflow: visible;
    }
    
    /* ===== MOBILE PRICE TAGS ===== */
    .slide-price {
        margin-bottom: 1.5rem;
        display: flex;
        gap: 0.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .free-tag,
    .price-tag,
    .coming-soon-tag {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* ===== MOBILE IMAGE ===== */
    .slide-image {
        margin-bottom: 1.5rem;
    }
    
    .slide-image img {
        max-width: 100%;
        height: auto;
        max-height: 250px;
        border-radius: 12px;
    }
    
    /* ===== MOBILE FEATURES ===== */
    .slide-features {
        justify-content: flex-start;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .feature-tag {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* ===== MOBILE META INFO ===== */
    .plugin-meta {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 1rem 0;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .meta-item {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .meta-label {
        font-size: 0.8rem;
    }
    
    .meta-value {
        font-size: 0.9rem;
    }
    
    /* ===== MOBILE STAR RATING ===== */
    .meta-star-rating {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .meta-star-rating .stars {
        font-size: 1rem;
    }
    
    .meta-star-rating .rating-text {
        font-size: 0.8rem;
    }
    
    .popularity-score {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
    
    /* ===== MOBILE NAVIGATION ===== */
    .slide-navigation {
        left: 0.5rem;
        right: 0.5rem;
        top: calc(50% - 80px); /* ปรับตำแหน่งหลีกเลี่ยง sidebar */
    }
    
    .nav-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        background: rgba(0, 170, 255, 0.9);
        backdrop-filter: blur(15px);
    }
    
    /* ===== MOBILE ACTIONS ===== */
    .slide-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .btn-download,
    .btn-purchase,
    .btn-forum {
        width: 100%;
        max-width: none;
        padding: 1rem;
        font-size: 1rem;
        min-height: 50px;
        border-radius: 12px;
    }
    
    /* ===== MOBILE PROGRESS BAR ===== */
    .slide-progress {
        padding: 0.75rem 1rem;
        order: 3; /* อยู่ล่างสุด */
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
}

/* ===== SMALL MOBILE (320px-480px) ===== */
@media (max-width: 480px) {
    .slide-content {
        padding: 0.75rem 0.5rem;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    .slide-description {
        font-size: 0.95rem;
    }
    
    .plugin-meta {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .meta-item {
        padding: 0.5rem;
    }
    
    .slide-thumbnail {
        min-width: 140px;
        max-width: 140px;
        height: 70px;
        padding: 0.5rem;
    }
    
    .slide-thumbnail img {
        width: 35px;
        height: 35px;
    }
    
    .slide-thumbnail h4 {
        font-size: 0.75rem;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .btn-download,
    .btn-purchase,
    .btn-forum {
        padding: 0.875rem;
        font-size: 0.95rem;
        min-height: 45px;
    }
}

/* ===== TABLET (768px-1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .slide-presentation-container {
        flex-direction: row;
    }
    
    .slides-sidebar {
        width: 280px;
        height: 100vh;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }
    
    .sidebar-header {
        display: block;
    }
    
    .slides-list {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .slide-thumbnail {
        width: 100%;
        height: auto;
        min-width: auto;
        max-width: none;
        flex-direction: row;
        text-align: left;
        padding: 1rem;
    }
    
    .slide-thumbnail img {
        width: 45px;
        height: 45px;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }
    
    .slide-thumbnail p {
        display: block;
    }
    
    .slide-content {
        padding: 1.5rem;
    }
    
    .plugin-slide {
        padding: 1.5rem;
    }
    
    .slide-title {
        font-size: 2rem;
    }
    
    .plugin-meta {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== VERY SMALL SCREENS (< 320px) ===== */
@media (max-width: 320px) {
    .slide-content {
        padding: 0.5rem 0.25rem;
    }
    
    .plugin-slide {
        padding: 1rem 0.75rem;
        border-radius: 15px;
    }
    
    .slide-title {
        font-size: 1.25rem;
        padding: 0 0.25rem;
    }
    
    .slide-description {
        font-size: 0.9rem;
        padding: 0 0.25rem;
    }
    
    .slide-image img {
        max-height: 200px;
        border-radius: 10px;
    }
    
    .slide-thumbnail {
        min-width: 120px;
        max-width: 120px;
        height: 65px;
        padding: 0.4rem;
    }
    
    .slide-thumbnail img {
        width: 30px;
        height: 30px;
    }
    
    .slide-thumbnail h4 {
        font-size: 0.7rem;
    }
    
    .feature-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .free-tag,
    .price-tag,
    .coming-soon-tag {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .nav-arrow {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* ===== HIGH-DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .slide-thumbnail img,
    .slide-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .plugin-slide {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    
    .meta-star-rating .star {
        color: #555;
    }
    
    .meta-star-rating .star.filled {
        color: #ffd700;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
}

/* ===== TOUCH-FRIENDLY IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Touch-friendly tap targets */
    .slide-thumbnail,
    .nav-arrow,
    .btn-download,
    .btn-purchase,
    .btn-forum {
        -webkit-tap-highlight-color: rgba(0, 170, 255, 0.2);
        tap-highlight-color: rgba(0, 170, 255, 0.2);
    }
    
    /* Prevent text selection on touch */
    .slide-thumbnail,
    .nav-arrow {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Smooth slide transitions for swipe */
    .slide-content {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Loading states for touch */
    .btn-download:active,
    .btn-purchase:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Better focus states for accessibility */
    .slide-thumbnail:focus,
    .nav-arrow:focus,
    .btn-download:focus,
    .btn-purchase:focus,
    .btn-forum:focus {
        outline: 2px solid var(--accent-blue);
        outline-offset: 2px;
    }
    
    /* Prevent horizontal scroll bounce */
    .slides-list {
        overscroll-behavior-x: contain;
    }
    
    /* Improve scroll performance */
    .slide-content {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* ===== SAFE AREA SUPPORT (iPhone X+) ===== */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .slide-content {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }
        
        .slide-progress {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
            padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        }
        
        .slides-sidebar {
            padding-left: max(0, env(safe-area-inset-left));
            padding-right: max(0, env(safe-area-inset-right));
        }
    }
}
