/**
 * M3U8 Video Downloader Styles
 * 
 * @author Video Extractor
 * @version 1.0.0
 */

/* ========== Base Styles ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
    min-height: 100vh;
    padding: 30px 15px;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ========== Typography ========== */
h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.2em;
    background: linear-gradient(90deg, #00d4ff, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 25px;
    font-size: 14px;
}

/* ========== Tab Navigation ========== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.tab:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.tab.active {
    background: linear-gradient(135deg, #00d4ff, #a855f7);
    color: #fff;
    border-color: transparent;
}

.tab-content {
    display: none;
}

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

/* ========== Card Component ========== */
.card {
    background: rgba(30, 30, 50, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.card h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.15em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h4 {
    color: #a855f7;
    margin-bottom: 15px;
}

.desc {
    color: #888;
    margin-bottom: 15px;
    font-size: 13px;
}

/* ========== Steps Instructions ========== */
.steps {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid #00d4ff;
    padding: 15px 20px;
    border-radius: 0 10px 10px 0;
    margin-bottom: 20px;
}

.steps ol {
    margin-left: 20px;
    line-height: 2;
}

.steps code {
    background: rgba(0,0,0,0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #4ade80;
}

/* ========== Form Elements ========== */
textarea,
input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

textarea {
    height: 180px;
    resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

textarea::placeholder,
input::placeholder {
    color: #666;
}

/* ========== Buttons ========== */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.flex-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========== Info Grid ========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item label {
    display: block;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-item .value {
    background: rgba(0,0,0,0.3);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ========== Result Display ========== */
.result-box {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.result-box label {
    color: #888;
    font-size: 12px;
    display: block;
    margin-bottom: 10px;
}

.url-display {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    word-break: break-all;
    color: #4ade80;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.url-display:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.thumbnail {
    max-width: 200px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ========== Progress Bar ========== */
.progress-container {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    display: none;
}

.progress-bar {
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d4ff, #a855f7, #ec4899);
    border-radius: 14px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.progress-text {
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ========== Download Complete ========== */
.download-complete {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    display: none;
}

.download-complete h4 {
    color: #22c55e;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* ========== Log Box ========== */
.log-box {
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    max-height: 250px;
    overflow-y: auto;
    margin: 15px 0;
    display: none;
}

.log-box::-webkit-scrollbar {
    width: 6px;
}

.log-box::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.log-box::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.log-error { color: #f87171; }
.log-success { color: #4ade80; }
.log-info { color: #60a5fa; }
.log-warning { color: #fbbf24; }

/* ========== Tips List ========== */
.tips {
    margin-left: 20px;
    line-height: 2;
    color: #888;
    font-size: 13px;
}

.tips a {
    color: #00d4ff;
    text-decoration: none;
}

.tips a:hover {
    text-decoration: underline;
}

/* ========== Message Alerts ========== */
.error-msg {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    padding: 15px;
    border-radius: 10px;
    color: #fca5a5;
    margin: 10px 0;
}

.success-msg {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    padding: 15px;
    border-radius: 10px;
    color: #86efac;
    margin: 10px 0;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    h1 {
        font-size: 1.6em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        text-align: center;
    }
    
    .card {
        padding: 20px;
    }
    
    .flex-buttons {
        flex-direction: column;
    }
    
    .flex-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Animations ========== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
