/* ============================================
   WM Video Watermark Tool - Enhanced UI v2.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* --- Main Container --- */
.wmvw-wrap {
    max-width: 960px;
    width: 95%;
    margin: 32px auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.wmvw-wrap h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.wmvw-wrap h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
}

/* --- Card / Panel --- */
.wmvw-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.wmvw-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
}

/* --- Section Title --- */
.wmvw-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.wmvw-badge {
    background: #ede9fe;
    color: #7c3aed;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.wmvw-badge-blue { background: #dbeafe; color: #1d4ed8; }
.wmvw-badge-green { background: #dcfce7; color: #15803d; }
.wmvw-badge-orange { background: #ffedd5; color: #c2410c; }

/* --- Grid --- */
.wmvw-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wmvw-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* --- Form Field --- */
.wmvw-field { margin-bottom: 16px; }

.wmvw-field label,
.wmvw-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wmvw-field input[type="text"],
.wmvw-field input[type="number"],
.wmvw-field textarea,
.wmvw-field select,
.wmvw-form input[type="text"],
.wmvw-form input[type="number"],
.wmvw-form textarea,
.wmvw-form select {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 10px 14px;
    color: #1e293b;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.wmvw-field input:focus,
.wmvw-field textarea:focus,
.wmvw-field select:focus,
.wmvw-form input[type="text"]:focus,
.wmvw-form input[type="number"]:focus,
.wmvw-form textarea:focus,
.wmvw-form select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: #ffffff;
}

.wmvw-field select,
.wmvw-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #f8fafc;
    padding-right: 36px;
}

/* Color Picker */
.wmvw-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wmvw-color-wrap input[type="color"] {
    width: 44px;
    height: 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 3px;
    cursor: pointer;
    background: #f8fafc;
    flex-shrink: 0;
}
.wmvw-color-wrap input[type="text"] { flex: 1; }

/* --- File Drop Zone --- */
.wmvw-file-drop {
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    background: #f5f3ff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.wmvw-file-drop:hover, .wmvw-file-drop.drag-over {
    border-color: #6366f1;
    background: #ede9fe;
}
.wmvw-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.wmvw-file-icon { font-size: 1.8rem; line-height: 1; }
.wmvw-file-label { font-weight: 600; color: #4f46e5; font-size: 0.9rem; }
.wmvw-file-sub { color: #94a3b8; font-size: 0.77rem; }
.wmvw-file-drop.wmvw-file-selected { border-color: #22c55e; background: #f0fdf4; }
.wmvw-file-selected-name { font-size: 0.8rem; color: #16a34a; font-weight: 600; margin-top: 4px; }

/* --- Saved Files Panel --- */
.wmvw-saved-panel {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
}
.wmvw-saved-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wmvw-saved-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 150px;
    overflow-y: auto;
}
.wmvw-saved-list li label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.15s;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0;
}
.wmvw-saved-list li label:hover { border-color: #a5b4fc; background: #eef2ff; color: #4f46e5; }
.wmvw-saved-list li input[type="radio"] { accent-color: #6366f1; width: 15px; height: 15px; flex-shrink: 0; }
.wmvw-saved-empty { color: #94a3b8; font-size: 0.82rem; font-style: italic; }

/* --- Toggle Switch --- */
.wmvw-toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wmvw-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.wmvw-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.wmvw-toggle-slider {
    position: absolute; inset: 0;
    background: #cbd5e1; border-radius: 999px; transition: background 0.2s; cursor: pointer;
}
.wmvw-toggle-slider::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; border-radius: 50%; background: white;
    top: 3px; left: 3px; transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.wmvw-toggle input:checked + .wmvw-toggle-slider { background: #6366f1; }
.wmvw-toggle input:checked + .wmvw-toggle-slider::before { transform: translateX(20px); }
.wmvw-toggle-label { font-size: 0.9rem; font-weight: 500; color: #334155; cursor: pointer; }

/* --- Position Buttons --- */
.wmvw-pos-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wmvw-pos-btn {
    padding: 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.wmvw-pos-btn:hover, .wmvw-pos-btn.active {
    border-color: #6366f1; background: #eef2ff; color: #4f46e5;
}
.wmvw-pos-btn.active { box-shadow: 0 0 0 2px rgba(99,102,241,0.3); }

/* --- Divider & Desc --- */
.wmvw-divider { border: none; border-top: 1px solid #f1f5f9; margin: 20px 0; }
.wmvw-desc { font-size: 0.8rem; color: #94a3b8; margin-top: 5px; line-height: 1.5; }

/* --- Primary Button --- */
.wmvw-btn-primary,
.wmvw-form .button.button-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 32px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
    text-transform: none;
    letter-spacing: 0.01em;
}
.wmvw-btn-primary:hover, .wmvw-form .button.button-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 6px 18px rgba(79,70,229,0.45);
    transform: translateY(-1px);
    color: #fff;
}

/* --- Progress --- */
.wmvw-progress-wrap { margin-top: 24px; display: none; }
.wmvw-progress-bar {
    width: 100%; background: #e2e8f0; border-radius: 999px;
    overflow: hidden; height: 10px; border: none;
}
.wmvw-progress-inner {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    transition: width 0.4s ease; border-radius: 999px;
}
.wmvw-progress-text { margin-top: 8px; font-size: 0.83rem; color: #6366f1; font-weight: 600; text-align: right; }

/* --- Results --- */
.wmvw-results { margin-top: 32px; }
.wmvw-results h3 { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 18px; }
.wmvw-results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }

.wmvw-item {
    background: #ffffff; border-radius: 14px; padding: 18px;
    border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wmvw-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.wmvw-item-error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.wmvw-item video {
    width: 100%; max-height: 260px; border-radius: 10px;
    margin: 10px 0; background: #0f172a; display: block;
}
.wmvw-item-name { font-weight: 700; color: #0f172a; font-size: 0.9rem; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmvw-item-meta { font-size: 0.78rem; color: #94a3b8; margin-bottom: 3px; }
.wmvw-item-actions { display: flex; gap: 8px; margin-top: 12px; }
.wmvw-btn-download {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f1f5f9; border: 1.5px solid #e2e8f0; color: #334155;
    padding: 8px 18px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all 0.15s; font-family: inherit;
}
.wmvw-btn-download:hover { background: #e2e8f0; color: #0f172a; border-color: #cbd5e1; }

/* --- Intro/Outro section --- */
.wmvw-intoutro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .wmvw-wrap { width: 100%; margin: 0; }
    .wmvw-card { padding: 16px; border-radius: 10px; }
    .wmvw-grid-2, .wmvw-grid-3, .wmvw-intoutro-grid { grid-template-columns: 1fr; }
    .wmvw-btn-primary, .wmvw-form .button.button-primary { width: 100%; justify-content: center; }
    .wmvw-results-grid { grid-template-columns: 1fr; }
}

/* --- Admin Media List --- */
.wmvw-admin-media-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.wmvw-admin-media-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem; font-weight: 500; color: #334155;
}
.wmvw-admin-media-list li img {
    width: 36px; height: 36px; object-fit: cover;
    border-radius: 6px; border: 1px solid #e2e8f0; flex-shrink: 0;
}
.wmvw-admin-media-list li .wmvw-video-icon { font-size: 1.4rem; flex-shrink: 0; }
.wmvw-admin-media-list li span { flex: 1; }
.wmvw-btn-delete {
    background: #fef2f2; border: 1.5px solid #fca5a5; color: #dc2626;
    border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; text-decoration: none; transition: all 0.15s; flex-shrink: 0;
}
.wmvw-btn-delete:hover { background: #fee2e2; color: #b91c1c; border-color: #f87171; }

/* --- Admin input full width --- */
.wmvw-input-full {
    width: 100%; background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 9px; padding: 10px 14px; color: #1e293b;
    font-size: 0.95rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wmvw-input-full:focus {
    border-color: #6366f1; outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15); background: #fff;
}
