/* CDN QA Test Site - Stylesheet */
/* 用於測試 CSS MIME Type (text/css) 及壓縮 (Gzip/Brotli) */

/* ========================================
   Font Face Definitions - 測試字型 CORS 與 MIME Type
   ======================================== */

@font-face {
    font-family: 'TestFont-WOFF2';
    src: url('./test-fonts/test-font.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TestFont-WOFF';
    src: url('./test-fonts/test-font.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TestFont-TTF';
    src: url('./test-fonts/test-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TestFont-OTF';
    src: url('./test-fonts/test-font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   CSS Reset & Base Styles
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.28)), url('./test-images/placeholder.svg') center center / cover no-repeat fixed;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 28px 28px 32px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

/* Page header & top navigation */

.page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.page-title-group h1 {
    margin: 0 0 6px;
    color: #2d3748;
    font-size: 2.3rem;
}

.page-title-group .subtitle {
    margin: 0;
    color: #718096;
    text-align: center;
}

.env-badge {
    align-self: flex-end;
    text-align: right;
}

.env-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0aec0;
}

.env-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ebf4ff;
    color: #4c51bf;
    font-size: 0.75rem;
    font-weight: 600;
}

.section-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 28px;
    padding: 8px 10px;
    background: #edf2f7;
    border-radius: 999px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.section-nav a {
    flex: 1 1 0;
    text-align: center;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #4a5568;
    background: transparent;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.section-nav a:hover {
    background: #4c51bf;
    color: #fff;
    transform: translateY(-1px);
}

.section-nav a.active {
    background: #4c51bf;
    color: #fff;
}

/* ========================================
   Section Styles
   ======================================== */

.test-section {
    margin-bottom: 32px;
    padding: 22px 22px 24px;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.test-section h2 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-section h2::before {
    content: '▶';
    color: #667eea;
    font-size: 0.8em;
}

.section-desc {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 10px 12px;
    background: #edf2f7;
    border-radius: 8px;
}

/* Tabbed sections */

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

/* ========================================
   Image Gallery
   ======================================== */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-card .info {
    padding: 12px;
    font-size: 0.85rem;
}

.image-card .filename {
    font-weight: 600;
    color: #2d3748;
    word-break: break-all;
}

.image-card .format {
    color: #667eea;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ========================================
   Font Test Section
   ======================================== */

.font-sample {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.font-sample .label {
    font-size: 0.75rem;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.font-woff2 {
    font-family: 'TestFont-WOFF2', serif;
    font-size: 1.5rem;
}

.font-woff {
    font-family: 'TestFont-WOFF', serif;
    font-size: 1.5rem;
}

.font-ttf {
    font-family: 'TestFont-TTF', serif;
    font-size: 1.5rem;
}

.font-otf {
    font-family: 'TestFont-OTF', serif;
    font-size: 1.5rem;
}

/* ========================================
   Video Section
   ======================================== */

.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-card video {
    width: 100%;
    display: block;
}

.video-card .info {
    padding: 12px;
}

/* ========================================
   Download Section
   ======================================== */

.download-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3748;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.download-item:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

.download-item .icon {
    font-size: 1.5rem;
}

.download-item .details {
    flex: 1;
}

.download-item .filename {
    font-weight: 600;
    font-size: 0.9rem;
}

.download-item .size {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========================================
   WAF Test Section
   ======================================== */

.waf-section {
    border-left-color: #e53e3e;
}

.waf-section h2::before {
    color: #e53e3e;
}

.waf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.waf-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.waf-btn-xss {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
}

.waf-btn-sqli {
    background: linear-gradient(135deg, #ed8936 0%, #c05621 100%);
    color: white;
}

.waf-btn-path {
    background: linear-gradient(135deg, #9f7aea 0%, #6b46c1 100%);
    color: white;
}

.waf-btn-cmd {
    background: linear-gradient(135deg, #48bb78 0%, #276749 100%);
    color: white;
}

.waf-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.waf-result {
    padding: 20px;
    background: #1a202c;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #68d391;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.waf-result .log-entry {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d3748;
}

.waf-result .timestamp {
    color: #718096;
}

.waf-result .status-200 {
    color: #68d391;
}

.waf-result .status-403 {
    color: #fc8181;
}

.waf-result .status-error {
    color: #f6ad55;
}

/* ========================================
   JSON Data Section
   ======================================== */

.json-output {
    padding: 20px;
    background: #1a202c;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #68d391;
    white-space: pre-wrap;
    word-break: break-all;
}

.cache-panel {
    background: #0f172a;
    padding: 16px;
    border-radius: 10px;
}

/* ========================================
   Audio Section
   ======================================== */

.audio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.audio-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.audio-card audio {
    width: 100%;
    margin-top: 10px;
}

.audio-card .filename {
    font-weight: 600;
    color: #2d3748;
}

.audio-card .format {
    color: #667eea;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.85rem;
}

/* ========================================
   Utility Classes
   ======================================== */

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-success {
    background: #68d391;
}

.status-error {
    background: #fc8181;
}

.status-pending {
    background: #f6ad55;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 16px 14px 22px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title-group h1 {
        font-size: 1.8rem;
    }

    .env-badge {
        text-align: left;
    }
    
    .video-gallery {
        grid-template-columns: 1fr;
    }
    
    .waf-buttons {
        flex-direction: column;
    }
    
    .waf-btn {
        width: 100%;
        justify-content: center;
    }
}
