/* 
  ad-player.css - v5.0 (Standard-Compliant Rewrite)
  Implements the native app's design standard for H5.
*/

/* --- Standard: Global Style Definitions (Root Variables) --- */
:root {
    --color-background: #1a1a2e;
    --color-overlay: rgba(26, 26, 46, 0.85);
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;
    --color-accent: #3498db;
    --color-danger: #e74c3c;
    --color-danger-hover: #c0392b;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Base Setup --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    background-color: var(--color-background);
}

/* --- Standard: Two-Layer Layout Container --- */
.ad-player-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* --- Layer 1: The Background --- */
.ad-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.ad-background img {
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    transform: translateY(0); /* Initial position for JS animation */
}

/* --- Layer 2: The UI Overlay --- */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    
    background-color: var(--color-overlay);
    color: var(--color-text-primary);
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    
    padding: 20px;
    box-sizing: border-box;
}

/* --- Reusable UI Components --- */

/* Top Status Bar */
.status-bar {
    width: 100%;
    display: flex;
    justify-content: space-around;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 10px 0 20px;
    margin: -20px -20px 0;
}

.status-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px #000;
}

.status-value {
    font-size: 15px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* Middle Status Text */
.ad-text {
    font-size: 18px;
    font-weight: 500;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    text-shadow: 1px 1px 2px #000;
    animation: pulse 2s infinite ease-in-out;
}

/* Bottom Control Bar */
.bottom-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--color-accent);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: bold;
}

.stop-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: var(--color-danger);
    border: none;
    border-radius: 10px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stop-btn:hover {
    background-color: var(--color-danger-hover);
}

/* --- Standard: Animations --- */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}