/* 攝影教學頁面樣式 - 紅黑主題 */

/* 基礎設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS變數定義 */
:root {
    --primary-red: #e74c3c;
    --dark-red: #c0392b;
    --primary-black: #1a1a1a;
    --secondary-black: #2c2c2c;
    --text-light: #f0f0f0;
    --text-gray: #999;
    --accent-gold: #f39c12;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --border-color: rgba(231, 76, 60, 0.2);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 10px 25px rgba(231, 76, 60, 0.2);
    --shadow-heavy: 0 15px 35px rgba(231, 76, 60, 0.3);
}

/* 頁面標題 */
.page-header {
    background: var(--primary-black);
    color: var(--text-light);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.5) 100%);
    z-index: 2;
}

.page-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 10;
}

.page-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    position: relative;
    z-index: 10;
}

.tutorials-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-red);
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    display: block;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 10;
}

/* 篩選區域 */
.tutorials-filters {
    background: var(--secondary-black);
    padding: 3rem 0;
    border-bottom: 2px solid var(--primary-red);
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.filters-wrapper {
    background: var(--primary-black);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

/* 搜索區域 */
.search-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    max-width: 600px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 4rem 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: var(--secondary-black);
    color: var(--text-light);
    box-shadow: var(--shadow-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--primary-black);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.search-input::placeholder {
    color: var(--text-gray);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-red);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: var(--dark-red);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* 篩選選項 */
.filter-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.filter-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    border-color: var(--primary-red);
    background: rgba(231, 76, 60, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

/* 清除篩選 */
.clear-filters {
    text-align: center;
}

.btn-outline {
    background: var(--secondary-black);
    color: var(--text-light);
    border: 2px solid var(--primary-red);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-outline:hover {
    background: var(--primary-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 教學網格 */
.tutorials-grid {
    padding: 4rem 0;
    background: var(--primary-black);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tutorial-card {
    background: var(--secondary-black);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
    opacity: 1;
    transform: translateY(0);
}

/* 初始狀態（用於動畫） */
.tutorial-card.fade-in {
    opacity: 0;
    transform: translateY(50px);
}

.tutorial-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-red);
}

/* 教學圖片容器 */
.tutorial-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.tutorial-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tutorial-card:hover .tutorial-image {
    transform: scale(1.1);
}

.featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-gold);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.5);
}

/* 教學覆蓋層 */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tutorial-card:hover .tutorial-overlay {
    opacity: 1;
}

.tutorial-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: var(--primary-red);
    transform: scale(1.1);
    border-color: var(--primary-red);
}

.action-btn.favorited {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

/* 難度指示器 */
.difficulty-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.difficulty-stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #ddd;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.star.active {
    color: var(--warning-color);
}

/* 教學內容 */
.card-content {
    padding: 1.5rem;
    background: var(--secondary-black);
    color: var(--text-light);
}

.tutorial-title {
    margin-bottom: 1rem;
}

.tutorial-title a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.tutorial-title a:hover {
    color: var(--primary-red);
}

.tutorial-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.tutorial-category {
    background: rgba(231, 76, 60, 0.2);
    color: var(--primary-red);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
}

.tutorial-duration {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tutorial-summary {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 主題標籤 */
.tutorial-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--primary-red);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: scale(1);
}

.tag:hover {
    background: var(--dark-red);
    transform: scale(1.05) !important;
}

.more-tag {
    background: var(--text-gray);
    cursor: default;
}

.more-tag:hover {
    background: var(--text-gray);
    transform: scale(1) !important;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tutorial-level {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.level-初學者 {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

.level-中級 {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

.level-高級 {
    background: rgba(231, 76, 60, 0.2);
    color: var(--primary-red);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-sm:hover {
    background: var(--dark-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* 無結果狀態 */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
    background: var(--secondary-black);
    border-radius: 15px;
    margin: 2rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.no-results p {
    margin-bottom: 2rem;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    background: var(--secondary-black);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.pagination-btn,
.pagination-current {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.pagination-current {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

/* 精選教學區塊 */
.featured-tutorials-section {
    background: var(--secondary-black);
    padding: 4rem 0;
    text-align: center;
}

.featured-tutorials-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.featured-tutorials-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.featured-card {
    background: var(--primary-black);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.featured-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-red);
}

.featured-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.featured-content {
    padding: 1.5rem;
    color: var(--text-light);
}

.featured-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.featured-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* 載入覆蓋層 */
.filter-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: var(--text-light);
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
}

.spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border: 2px solid transparent;
    border-top: 2px solid var(--warning-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 1rem;
    color: var(--text-gray);
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--secondary-black);
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.toast.toast-error {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.toast.toast-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.toast.toast-info {
    background: var(--info-color);
    border-color: var(--info-color);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .filter-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .tutorial-actions {
        gap: 0.5rem;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .pagination-btn,
    .pagination-current {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 2rem 0;
    }
    
    .tutorials-filters {
        padding: 2rem 0;
    }
    
    .filters-container {
        padding: 0 1rem;
    }
    
    .search-input {
        padding: 0.8rem 3.5rem 0.8rem 1rem;
    }
    
    .search-button {
        width: 35px;
        height: 35px;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .tutorial-topics {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .btn-sm {
        text-align: center;
    }
}