/* SlideShare Downloader — v2.0 */

/* ── Container ──────────────────────────────────────────────────── */
.ssd-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(102,126,234,0.35);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────── */
.ssd-header {
    text-align: center;
    margin-bottom: 28px;
}
.ssd-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
    letter-spacing: -0.5px;
}
.ssd-header p {
    font-size: 1rem;
    opacity: 0.88;
    margin: 0;
}

/* ── URL input row ───────────────────────────────────────────────── */
.ssd-input-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.ssd-url-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255,255,255,0.95);
    color: #333;
    outline: none;
    transition: border-color .2s;
    min-width: 0;
}
.ssd-url-input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.ssd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 22px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    white-space: nowrap;
}
.ssd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ssd-btn:not(:disabled):hover { opacity: 0.9; }
.ssd-btn:not(:disabled):active { transform: scale(0.97); }

.ssd-btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #fff;
    min-width: 160px;
}
.ssd-btn-download {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
    padding: 15px 30px;
    font-size: 16px;
}
.ssd-btn-sm {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.4);
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}
.ssd-btn-sm:hover { background: rgba(255,255,255,0.28); }

/* ── Options panel ───────────────────────────────────────────────── */
.ssd-options-panel {
    margin-top: 28px;
}
.ssd-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.12);
    border-radius: 14px;
}
.ssd-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ssd-control-group label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ssd-control-group select {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.92);
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.ssd-selection-btns {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* ── Slide info strip ────────────────────────────────────────────── */
.ssd-slide-info {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 14px;
    padding: 0 2px;
}
.ssd-slide-info strong { color: #fff; }

/* ── Slides grid ─────────────────────────────────────────────────── */
.ssd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
.ssd-grid::-webkit-scrollbar { width: 6px; }
.ssd-grid::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 3px; }
.ssd-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 3px; }

.ssd-slide {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color .15s, transform .15s, box-shadow .15s;
    background: rgba(255,255,255,0.08);
}
.ssd-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.ssd-slide.ssd-selected {
    border-color: #38ef7d;
    box-shadow: 0 0 0 2px rgba(56,239,125,0.4);
}
.ssd-slide.ssd-selected::after {
    content: '\2713';
    position: absolute;
    top: 6px;
    right: 8px;
    background: #38ef7d;
    color: #1a5c38;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}
.ssd-slide img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.ssd-slide-num {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-align: center;
    background: rgba(0,0,0,0.25);
}
.ssd-slide.ssd-img-error img {
    opacity: 0.5;
}

/* ── Download bar ────────────────────────────────────────────────── */
.ssd-download-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
}
.ssd-count-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

/* ── Spinner ─────────────────────────────────────────────────────── */
.ssd-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ssd-spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes ssd-spin { to { transform: rotate(360deg); } }

/* ── Notices ─────────────────────────────────────────────────────── */
.ssd-notice {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}
.ssd-error   { background: rgba(231,76,60,0.9); }
.ssd-success { background: rgba(39,174,96,0.9); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ssd-container { padding: 20px 16px; }
    .ssd-header h2 { font-size: 1.4rem; }
    .ssd-input-row { flex-direction: column; }
    .ssd-btn-primary { width: 100%; }
    .ssd-controls-row { flex-direction: column; }
    .ssd-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ssd-download-bar { flex-direction: column; text-align: center; }
}
