/* ===============================================================
   iWishs Media Gallery Pro - 精緻文件風格 v2.3.1
   配色：白色、漸層灰、金色星星
   =============================================================== */

/* ==================== 資料夾標題 ==================== */
.iwishs-folder-header {
    margin: 40px 0 30px 0;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.iwishs-folder-title {
    margin: 0;
    font-size: 26px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.iwishs-folder-title a {
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.iwishs-folder-title a:hover {
    color: #b8860b;
}

.iwishs-folder-icon {
    font-size: 30px;
}

.iwishs-folder-count {
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.iwishs-folder-desc {
    margin: 12px 0 0;
    color: #6c757d;
    font-size: 15px;
    line-height: 1.6;
}

/* ==================== 畫廊容器 ==================== */
.iwishs-gallery {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

/* 桌機：一列 3 張（更大） */
.iwishs-cols-1 { grid-template-columns: 1fr; }
.iwishs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.iwishs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.iwishs-cols-4 { grid-template-columns: repeat(4, 1fr); }
.iwishs-cols-5 { grid-template-columns: repeat(5, 1fr); }
.iwishs-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ==================== 畫廊項目 ==================== */
.iwishs-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    border: 1px solid #e9ecef;
}

.iwishs-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.iwishs-link {
    display: block;
    text-decoration: none;
}

.iwishs-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.iwishs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 48px;
}

.iwishs-item:hover .iwishs-overlay {
    opacity: 1;
}

.iwishs-caption {
    margin: 0;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    background: #fff;
    text-align: center;
    border-top: 1px solid #f1f3f5;
}

/* ==================== PDF 精緻文件卡片 ==================== */
.iwishs-item.iwishs-mime-application-pdf {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.iwishs-pdf-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.iwishs-pdf-link:hover .iwishs-pdf-card {
    /* 懸停效果由父元素處理 */
}

/* PDF 封面容器 - 精緻漸層灰 */
.iwishs-pdf-cover {
    position: relative;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 50%, #e8e8e8 100%);
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    border-bottom: 1px solid #e0e0e0;
}

/* 文件紙張效果 */
.iwishs-pdf-cover::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
    border-radius: 8px;
    pointer-events: none;
}

/* PDF Canvas 樣式 */
.iwishs-pdf-canvas {
    max-width: 100%;
    max-height: 290px;
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.1),
        0 8px 30px rgba(0,0,0,0.12);
    border-radius: 4px;
    background: #fff;
    position: relative;
    z-index: 1;
}

/* 載入動畫 */
.iwishs-pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 50%, #e8e8e8 100%);
    z-index: 2;
}

.iwishs-pdf-loading.hidden {
    display: none;
}

.iwishs-spinner {
    width: 45px;
    height: 45px;
    border: 3px solid #e0e0e0;
    border-top-color: #b8860b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 金色星星徽章 */
.iwishs-pdf-badge {
    text-align: center;
    padding: 14px 20px;
    font-size: 20px;
    letter-spacing: 6px;
    background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    /* 金色星星 */
    color: transparent;
    background-image: linear-gradient(180deg, #d4af37 0%, #b8860b 50%, #996515 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(184, 134, 11, 0.3);
}

/* PDF 標題 - 精緻灰色 */
.iwishs-item.iwishs-mime-application-pdf .iwishs-caption {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    padding: 18px 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.iwishs-item.iwishs-mime-application-pdf .iwishs-overlay {
    display: none;
}

/* ==================== 其他文件類型 ==================== */
.iwishs-file-box {
    width: 100%;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
}

.iwishs-icon {
    font-size: 72px;
    margin-bottom: 15px;
}

.iwishs-ext {
    font-size: 13px;
    font-weight: 700;
    color: #6c757d;
    background: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Word */
.iwishs-mime-application-msword .iwishs-file-box,
.iwishs-mime-application-vnd-openxmlformats-officedocument-wordprocessingml-document .iwishs-file-box {
    background: linear-gradient(180deg, #f8fbff 0%, #e8f4fd 100%);
}

/* Excel */
.iwishs-mime-application-vnd-ms-excel .iwishs-file-box,
.iwishs-mime-application-vnd-openxmlformats-officedocument-spreadsheetml-sheet .iwishs-file-box {
    background: linear-gradient(180deg, #f8fff8 0%, #e8f5e9 100%);
}

/* ==================== 無檔案訊息 ==================== */
.iwishs-no-files {
    text-align: center;
    padding: 80px 30px;
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    border-radius: 16px;
    color: #6c757d;
    font-size: 18px;
    margin: 30px 0;
    border: 1px solid #e9ecef;
}

/* ==================== v2.4.0 前台搜尋列 ==================== */
.iwishs-search-bar {
    margin: 0 0 20px 0;
}

.iwishs-search-input {
    width: 100%;
    max-width: 400px;
    height: 44px;
    padding: 0 18px;
    border: 2px solid #e9ecef;
    border-radius: 22px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fff;
    box-sizing: border-box;
}

.iwishs-search-input:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
    outline: none;
}

/* ==================== Lightbox ==================== */
.iwishs-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.iwishs-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.iwishs-lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.iwishs-lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.iwishs-lightbox-close:hover {
    color: #b8860b;
    transform: rotate(90deg);
}

.iwishs-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 45px;
    color: #fff;
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s;
}

.iwishs-lightbox-nav:hover {
    color: #b8860b;
}

.iwishs-lightbox-prev { left: 25px; }
.iwishs-lightbox-next { right: 25px; }

/* ==================== 響應式 ==================== */
@media (max-width: 1200px) {
    .iwishs-cols-3, .iwishs-cols-4, .iwishs-cols-5, .iwishs-cols-6 { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 992px) {
    .iwishs-cols-3, .iwishs-cols-4, .iwishs-cols-5, .iwishs-cols-6 { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .iwishs-pdf-cover { min-height: 280px; }
    .iwishs-pdf-canvas { max-height: 250px; }
}

@media (max-width: 768px) {
    .iwishs-gallery { gap: 20px; }
    .iwishs-cols-2, .iwishs-cols-3, .iwishs-cols-4, .iwishs-cols-5, .iwishs-cols-6 { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .iwishs-pdf-cover { min-height: 240px; padding: 20px; }
    .iwishs-pdf-canvas { max-height: 210px; }
    .iwishs-pdf-badge { font-size: 18px; padding: 12px; letter-spacing: 4px; }
    .iwishs-folder-title { font-size: 22px; }
}

@media (max-width: 576px) {
    .iwishs-cols-2, .iwishs-cols-3, .iwishs-cols-4, .iwishs-cols-5, .iwishs-cols-6 { 
        grid-template-columns: 1fr; 
    }
    .iwishs-pdf-cover { min-height: 300px; }
    .iwishs-pdf-canvas { max-height: 270px; }
    .iwishs-item.iwishs-mime-application-pdf .iwishs-caption {
        font-size: 13px;
        padding: 15px;
    }
}

/* ==================== 精緻細節 ==================== */

/* 卡片內陰影效果 */
.iwishs-pdf-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 100%);
    pointer-events: none;
}

/* 懸停時的金色光暈 */
.iwishs-item.iwishs-mime-application-pdf:hover {
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.1),
        0 0 0 1px rgba(184, 134, 11, 0.2);
}

/* 懸停時星星閃爍 */
.iwishs-item.iwishs-mime-application-pdf:hover .iwishs-pdf-badge {
    animation: starGlow 1.5s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 文件封面懸停效果 */
.iwishs-item.iwishs-mime-application-pdf:hover .iwishs-pdf-canvas {
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.15),
        0 12px 40px rgba(0,0,0,0.15);
}
