/* SlideShare Real Downloader - Modern Clean UI */
.srd-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

.srd-main-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
}

.srd-form {
    display: flex !important;
    align-items: flex-start;
    gap: 16px;
    width: 100% !important;
    max-width: 100%;
}

.srd-input-wrapper {
    display: block !important;
    position: relative;
    /* flex-basis: 0% (not "auto") is what makes this bulletproof: with
       "auto" a flex item's width can still fall back to shrink-wrapping its
       content in some nested-flex edge cases. Basis 0 ignores content size
       entirely and grows purely from available space via flex-grow. */
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
}

/* High-specificity + !important guards below neutralize WordPress theme
   stylesheets (Astra, Divi, Elementor, WooCommerce, etc.) that commonly ship
   rules like input[type="url"] { width: 25%; } and would otherwise win the
   cascade since theme CSS is typically enqueued after plugin CSS. */
.srd-container .srd-form input.srd-input[type="url"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 60px !important;
    margin: 0 !important;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    color: #1e293b;
    padding: 0 24px !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.srd-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.srd-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Static, in-flow error message directly below the field (not absolutely
   positioned), so it never overlaps other content and never affects the
   field's own width calculation. */
.srd-error-msg {
    min-height: 0;
    margin-top: 0;
    font-size: 13px;
    color: #ef4444;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin-top 0.25s ease;
}

.srd-error-msg.visible {
    opacity: 1;
    max-height: 40px;
    margin-top: 8px;
    transform: translateY(0);
}

.srd-btn {
    height: 60px;
    background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    padding: 0 32px;
    white-space: nowrap;
    min-width: 190px;
    box-shadow: 0 2px 6px rgba(250, 204, 21, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.srd-btn .srd-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.srd-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(234, 179, 8, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.srd-btn:hover:not(:disabled) .srd-btn-icon {
    transform: translateY(2px);
}

.srd-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.35), 0 2px 6px rgba(250, 204, 21, 0.35);
}

.srd-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 4px rgba(234, 179, 8, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.srd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Processing Panel */
.srd-processing-panel {
    text-align: center;
    padding: 48px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 16px;
}

.srd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: srd-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes srd-spin {
    to { transform: rotate(360deg); }
}

.srd-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 16px;
}

.srd-progress-fill {
    width: 30%;
    height: 100%;
    background: #3b82f6;
    animation: srd-progress 2s ease-in-out infinite;
}

@keyframes srd-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.srd-status-msg {
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    margin: 0;
}

/* Success Panel */
.srd-success-panel {
    text-align: center;
    padding: 40px 24px;
    background: #f0f9ff;
    border-radius: 12px;
    margin-top: 16px;
    border: 1px solid #e0f2fe;
}

.srd-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.srd-meta {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
}

.srd-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.srd-btn-pdf, .srd-btn-zip {
    background: #3b82f6;
    color: #ffffff;
    height: 48px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 10px;
}

.srd-btn-pdf:hover, .srd-btn-zip:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.srd-reset-link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 8px;
    transition: color 0.2s;
}

.srd-reset-link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

/* Error Panel */
.srd-error-panel {
    text-align: center;
    padding: 40px 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin-top: 16px;
}

.srd-error-text {
    font-size: 15px;
    color: #991b1b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.srd-btn-retry {
    background: #facc15;
    color: #0f172a;
    height: 44px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 10px;
}

.srd-btn-retry:hover {
    background: #eab308;
}

/* Screen Reader Only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Responsiveness */
@media (max-width: 768px) {
    .srd-container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .srd-main-box {
        padding: 24px;
        border-radius: 12px;
    }
    
    .srd-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .srd-input {
        height: 56px;
        font-size: 16px;
    }
    
    .srd-btn {
        width: 100%;
        height: 56px;
        min-width: auto;
    }
    
    .srd-actions {
        flex-direction: column;
    }
    
    .srd-btn-pdf, .srd-btn-zip {
        width: 100%;
    }
}