/* 
   LH Download Buddy - Premium Redesign CSS
   Focus: Beauty, Clarity, and High-Conversion
*/

:root {
    --lh-primary: #3b82f6;
    --lh-primary-dark: #2563eb;
    --lh-primary-hover: #1d4ed8;
    --lh-primary-glow: rgba(59, 130, 246, 0.2);
    --lh-success: #10b981;
    --lh-bg-page: #f8fafc;
    --lh-bg-card: #ffffff;
    --lh-text-head: #0f172a;
    --lh-text-body: #334155;
    --lh-text-muted: #64748b;
    --lh-border: #e2e8f0;
    --lh-radius-lg: 16px;
    --lh-radius-md: 12px;
    --lh-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.lh-dl-premium-container {
    max-width: 1000px;
    margin: 40px auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--lh-text-body);
    line-height: 1.6;
}

/* Typography Overrides */
.lh-dl-page-title {
    font-size: 2.25rem;
    color: var(--lh-text-head);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Disclosure */
.lh-dl-premium-disclosure {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: var(--lh-radius-md);
    padding: 12px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #92400e;
}

.lh-dl-premium-disclosure .dashicons {
    color: #f59e0b;
}

/* Centered Thumbnail Image */
.lh-dl-featured-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: transparent !important;
}

.lh-dl-main-img {
    max-width: 420px;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: var(--lh-radius-md);
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none !important;
}

/* Layout Grid */
.lh-dl-premium-content-grid {
    display: flex;
    gap: 40px;
}

/* Sidebar Option */
.layout-sidebar_left .lh-dl-premium-content-grid {
    flex-direction: row;
}

.layout-sidebar_left .lh-dl-action-column {
    flex: 0 0 340px;
    position: sticky;
    top: 20px;
}

.layout-sidebar_left .lh-dl-description-column {
    flex: 1;
}

/* Stacked Option */
.layout-stacked .lh-dl-premium-content-grid {
    flex-direction: column;
}

.layout-stacked .lh-dl-action-column {
    width: 100%;
    margin-bottom: 40px;
}

/* Action Hub Card */
.lh-dl-action-card {
    background: var(--lh-bg-card);
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-lg);
    padding: 30px;
    box-shadow: var(--lh-shadow);
    transition: transform 0.3s ease;
}

.lh-dl-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.lh-dl-stat-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: var(--lh-radius-md);
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.lh-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--lh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.lh-stat-value {
    font-weight: 700;
    color: var(--lh-text-head);
    font-size: 1.1rem;
}

/* Password Form */
.lh-dl-password-field {
    margin-bottom: 25px;
}

.lh-dl-password-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--lh-text-head);
}

.lh-dl-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.lh-dl-input-wrapper .dashicons {
    position: absolute;
    left: 15px;
    color: var(--lh-text-muted);
}

.lh-dl-input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--lh-border);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lh-dl-input-wrapper input:focus {
    outline: none;
    border-color: var(--lh-primary);
    box-shadow: 0 0 0 4px var(--lh-primary-glow);
}

/* Captcha */
.lh-dl-captcha-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* The Button */
.lh-dl-main-btn {
    width: 100%;
    background: var(--lh-primary);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--lh-radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.lh-dl-main-btn:hover {
    background: var(--lh-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.4);
}

.lh-dl-main-btn:active {
    transform: translateY(0);
}

.lh-dl-main-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Button States */
.lh-dl-main-btn.is-loading,
.lh-dl-sc-btn.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.lh-dl-main-btn.is-success,
.lh-dl-sc-btn.is-success {
    background: var(--lh-success) !important;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3) !important;
}

.lh-dl-main-btn.is-error,
.lh-dl-sc-btn.is-error {
    background: #ef4444 !important;
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3) !important;
}

.lh-dl-spinner {
    animation: lh-rotate 1s linear infinite;
    display: inline-block;
    line-height: 1;
}

@keyframes lh-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Description Container - THE ENDING */
.lh-dl-description-card {
    background: #fff;
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-lg);
    padding: 30px 40px 40px 40px;
    /* Reduced top padding */
    box-shadow: var(--lh-shadow);
}

.lh-dl-desc-body {
    font-size: 1.1rem;
    color: var(--lh-text-body);
}

.lh-dl-desc-body>*:first-child {
    margin-top: 0 !important;
    /* Remove top margin from first paragraph/heading */
}

.lh-dl-desc-body p {
    margin-bottom: 1.5em;
}

/* AJAX Messages - CLEANed UP to prevent jumping */
.lh-dl-buddy-message {
    display: none;
    /* Hide by default, handled by button states */
}

/* Responsive */
@media (max-width: 900px) {
    .lh-dl-premium-content-grid {
        flex-direction: column !important;
    }

    .lh-dl-action-column {
        width: 100% !important;
        position: static !important;
    }

    .lh-dl-page-title {
        font-size: 2rem;
    }
}

/* --- PREMIUM SHORTCODE STYLES --- */
.lh-dl-shortcode-card {
    background: #ffffff;
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-lg);
    padding: 25px;
    margin: 30px 0;
    box-shadow: var(--lh-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lh-dl-shortcode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.lh-dl-sc-body {
    display: flex;
    align-items: center;
    gap: 25px;
}

.lh-dl-sc-icon-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: var(--lh-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lh-primary);
    border: 1px solid #eef2f6;
}

.lh-dl-sc-icon-wrap .dashicons {
    width: 48px;
    height: 48px;
    font-size: 48px;
    /* Bigger Icon */
}

.lh-dl-sc-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Clean gap between title and meta instead of margins */
}

.lh-dl-sc-title {
    margin: 0 !important;
    /* Reset all margins to prevent vertical alignment issues */
    font-size: 1.25rem;
    font-weight: 500;
}

.lh-dl-sc-title a {
    color: var(--lh-text-head);
    text-decoration: underline;
    transition: color 0.2s;
}

.lh-dl-sc-title a:hover {
    color: var(--lh-primary);
}

.lh-dl-sc-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lh-dl-sc-meta-item {
    display: flex;
    flex-direction: column;
}

.lh-dl-sc-meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--lh-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.lh-dl-sc-meta-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--lh-text-body);
}

.lh-dl-sc-meta-sep {
    height: 24px;
    width: 1px;
    background: #e2e8f0;
}

.lh-dl-sc-action {
    flex-shrink: 0;
    align-self: center;
    /* Force vertical centering in the row */
    display: flex;
    align-items: center;
}

.lh-dl-sc-action form {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centered horizontally in the right column */
    justify-content: center;
    gap: 10px;
}

.lh-dl-sc-btn {
    background: var(--lh-primary);
    color: #fff !important;
    padding: 10px 20px;
    /* Reduced to match previous compact size */
    border-radius: var(--lh-radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    /* Slightly smaller text */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

.lh-dl-sc-btn:hover {
    background: var(--lh-primary-dark) !important;
}

.lh-dl-sc-btn:active {
    transform: scale(0.98);
}

.lh-dl-sc-pass-wrap {
    margin-bottom: 5px;
}

.lh-dl-sc-pass-input {
    padding: 8px 12px;
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-md);
    font-size: 0.9rem;
    width: 150px;
}

/* --- MODAL STYLES --- */
.lh-dl-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.lh-dl-modal.is-active {
    display: flex;
}

.lh-dl-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.lh-dl-modal-container {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    border-radius: var(--lh-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: lh-dl-modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lh-dl-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lh-dl-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--lh-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lh-dl-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--lh-text-head);
}

.lh-dl-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--lh-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.lh-dl-modal-close:hover {
    color: var(--lh-text-head);
}

.lh-dl-modal-body {
    padding: 25px;
    text-align: center;
}

.lh-dl-modal-body p {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--lh-text-body);
}

#lh-dl-modal-captcha-container {
    display: flex;
    justify-content: center;
    min-height: 78px;
}

body.lh-dl-modal-open {
    overflow: hidden;
}

/* Response for Shortcode */
@media (max-width: 650px) {
    .lh-dl-sc-body {
        flex-direction: column;
        text-align: center;
    }

    .lh-dl-sc-action form {
        align-items: center;
    }

    .lh-dl-sc-meta {
        justify-content: center;
    }
}