/* --- 1. Theme Conflict Resolution --- */

/* Hide the default theme page title only on the UVD template */
.page-template-uvd-page-template .entry-header, 
.page-template-uvd-page-template .page-header,
.page-template-uvd-page-template .post-title,
.page-template-uvd-page-template .entry-title,
.page-template-uvd-page-template .header-callout { 
    display: none !important; 
}

/* Adjust page padding to clear fixed headers */
.uvd-page-wrapper {
    padding-top: 120px; /* Adjust this value if your header is taller */
    padding-bottom: 60px;
    background: var(--bg-dark, #050505);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 2. Container & Layout --- */
.uvd-container {
    max-width: 650px;
    width: 95%;
    margin: 0 auto;
    padding: 30px;
    background: var(--bg-deep, #0a0e17);
    border: 1px solid var(--bg-panel, rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text-main, #e2e8f0);
    position: relative;
    z-index: 5;
}

.uvd-header h2 {
    margin: 0 0 10px 0;
    color: var(--text-light, #ffffff);
    font-family: var(--font-head, 'Space Grotesk', sans-serif);
    font-size: 28px;
    letter-spacing: -0.5px;
}

.uvd-header p {
    color: var(--text-muted, #94a3b8);
    margin-bottom: 25px;
    font-size: 15px;
}

/* --- 3. Input Group --- */
.uvd-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.uvd-container input[type="url"] {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--bg-panel, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    font-size: 16px;
    color: var(--text-light, #ffffff);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.uvd-container input[type="url"]:focus {
    border-color: var(--primary, #4F46E5);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

.uvd-container button[type="submit"] {
    background: var(--primary, #4F46E5);
    color: #ffffff;
    border: none;
    padding: 14px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    font-family: var(--font-head, sans-serif);
    transition: all 0.3s ease;
}

.uvd-container button[type="submit"]:hover {
    background: var(--accent-purple, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.uvd-container button[type="submit"]:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* --- 4. Options/Checkbox --- */
.uvd-options {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
}

.uvd-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
}

.uvd-checkbox-label input {
    margin-right: 10px;
    accent-color: var(--primary, #4F46E5);
    width: 18px;
    height: 18px;
}

/* --- 5. Feedback & Results --- */
.uvd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--accent-cyan, #06b6d4);
    border-radius: 50%;
    animation: uvd-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes uvd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-preview-card {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: uvdFadeIn 0.5s ease forwards;
}

.video-preview-card h4 {
    margin: 15px 0 5px;
    font-size: 18px;
    color: var(--text-light, #ffffff);
    font-family: var(--font-head, sans-serif);
}

.download-btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: var(--accent-green, #10b981);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

/* --- 6. Responsive Fixes --- */
@media (max-width: 480px) {
    .uvd-input-group {
        flex-direction: column;
    }
    .uvd-container button[type="submit"] {
        width: 100%;
    }
    .uvd-page-wrapper {
        padding-top: 80px;
    }
}

@keyframes uvdFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Optimization (768px and below) --- */
@media (max-width: 768px) {
    .uvd-page-wrapper {
        padding-top: 80px; /* Reduced for mobile headers */
        padding-left: 15px;
        padding-right: 15px;
    }

    .uvd-main-title {
        font-size: 1.8rem; /* Scaled down for small screens */
    }

    .uvd-container {
        padding: 20px;
        border-radius: 12px;
    }

    /* Stack the Input and Button */
    .uvd-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .uvd-container input[type="url"] {
        width: 100%;
        font-size: 14px; /* Prevents iOS auto-zoom on focus */
        padding: 12px;
    }

    .uvd-container button[type="submit"] {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }

    /* Make instructions more compact */
    .uvd-step-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .uvd-step {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 15px;
    }

    .step-num {
        margin: 0 15px 0 0; /* Move number to the side */
        flex-shrink: 0;
        width: 30px;
        height: 30px;
    }

    .uvd-step p {
        margin: 0;
        font-size: 14px;
    }
}

/* Fix for very small devices (320px) */
@media (max-width: 400px) {
    .uvd-header h2 {
        font-size: 20px;
    }
    
    .uvd-options {
        font-size: 12px;
    }
}