/**
 * Sareldo Download Manager - Frontend Stylesheet
 * Dark Glassmorphism, Modern SaaS Layout
 */

.sdm-container {
    max-width: 1200px;
    margin: 40px auto 80px;
    padding: 0 24px;
    color: #e2e8f0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.sdm-container * {
    box-sizing: border-box;
}

/* Header */
.sdm-header {
    text-align: center;
    margin-bottom: 48px;
}

.sdm-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(2, 132, 199, 0.12);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}

.sdm-pulse-dot {
    width: 8px;
    height: 8px;
    background: #0ea5e9;
    border-radius: 50%;
    box-shadow: 0 0 10px #0ea5e9;
    animation: sdm-pulse 2s infinite;
}

@keyframes sdm-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.sdm-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.sdm-subtitle {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Controls: Category Filter + Search */
.sdm-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    padding: 8px 12px;
    background: rgba(18, 20, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(12px);
}

.sdm-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sdm-filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdm-filter-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sdm-filter-btn.active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.sdm-search-wrap {
    position: relative;
    min-width: 280px;
    flex: 1;
    max-width: 380px;
}

.sdm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.sdm-search-input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    background: rgba(10, 11, 16, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sdm-search-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.sdm-search-input::placeholder {
    color: #64748b;
}

.sdm-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sdm-search-clear:hover {
    color: #f1f5f9;
}

/* Grid Layout */
.sdm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* Card */
.sdm-card {
    background: linear-gradient(180deg, rgba(22, 24, 34, 0.85) 0%, rgba(14, 16, 22, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.sdm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.sdm-card:hover {
    transform: translateY(-4px);
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 24px rgba(2, 132, 199, 0.15);
}

/* Card Header */
.sdm-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sdm-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s;
}

.sdm-card:hover .sdm-app-icon {
    transform: scale(1.05);
}

.sdm-icon-emerald { color: #34d399; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }
.sdm-icon-sky     { color: #38bdf8; background: rgba(2, 132, 199, 0.12); border-color: rgba(2, 132, 199, 0.25); }
.sdm-icon-purple  { color: #c084fc; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.25); }
.sdm-icon-amber   { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); }

.sdm-badges-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.sdm-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
}

.sdm-badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.sdm-badge-sky     { background: rgba(2, 132, 199, 0.15); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.3); }
.sdm-badge-purple  { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.sdm-badge-amber   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.sdm-version-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Card Body */
.sdm-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.sdm-card-title {
    font-size: 1.28rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.sdm-card-desc {
    font-size: 0.92rem;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0;
}

/* Card Meta */
.sdm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
}

.sdm-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sdm-meta-label {
    color: #64748b;
    font-weight: 500;
}

.sdm-meta-val {
    color: #cbd5e1;
    font-weight: 600;
}

/* Card Actions */
.sdm-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sdm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    line-height: 1.2;
}

.sdm-btn-primary {
    background: #0284c7;
    color: #ffffff;
    flex-grow: 1;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.sdm-btn-primary:hover {
    background: #0369a1;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.sdm-secondary-actions {
    display: flex;
    gap: 6px;
}

.sdm-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sdm-btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

/* Empty State */
.sdm-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(18, 20, 28, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #94a3b8;
}

/* Trust Strip */
.sdm-trust-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    background: rgba(18, 20, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 48px;
}

.sdm-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.4;
}

.sdm-trust-item strong {
    color: #e2e8f0;
}

/* FAQ / Accordion */
.sdm-faq-section {
    margin-bottom: 48px;
    background: rgba(18, 20, 28, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 36px 32px;
}

.sdm-faq-header {
    text-align: center;
    margin-bottom: 28px;
}

.sdm-faq-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.sdm-faq-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

.sdm-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 860px;
    margin: 0 auto;
}

.sdm-accordion-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.sdm-accordion-item.active {
    border-color: rgba(2, 132, 199, 0.3);
    background: rgba(2, 132, 199, 0.03);
}

.sdm-accordion-head {
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}

.sdm-accordion-head:hover {
    color: #38bdf8;
}

.sdm-accordion-arrow {
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #64748b;
}

.sdm-accordion-item.active .sdm-accordion-arrow {
    transform: rotate(180deg);
    color: #38bdf8;
}

.sdm-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s;
    padding: 0 20px;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.sdm-accordion-item.active .sdm-accordion-body {
    max-height: 400px;
    padding: 0 20px 20px;
}

.sdm-accordion-body ol {
    margin: 0;
    padding-left: 20px;
}

.sdm-accordion-body li {
    margin-bottom: 8px;
}

.sdm-accordion-body strong {
    color: #e2e8f0;
}

/* Footer Signature */
.sdm-footer-signature {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sdm-footer-sep {
    color: #475569;
}

.sdm-footer-signature a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.sdm-footer-signature a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Modals */
.sdm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.sdm-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.sdm-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.sdm-modal-dialog {
    position: relative;
    z-index: 1;
    background: #141722;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdm-modal-dialog-md {
    max-width: 580px;
}

.sdm-modal.active .sdm-modal-dialog {
    transform: scale(1);
}

.sdm-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 1.4rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sdm-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.sdm-modal-header {
    margin-bottom: 24px;
    text-align: center;
}

.sdm-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.sdm-modal-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.sdm-qr-box {
    background: #ffffff;
    padding: 16px;
    border-radius: 16px;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sdm-qr-box img {
    max-width: 100%;
    height: auto;
    display: block;
}

.sdm-qr-link-box {
    display: flex;
    gap: 8px;
}

.sdm-qr-link-box input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 8px;
}

.sdm-btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    background: #0284c7;
    color: #ffffff;
}

/* Changelog Modal */
.sdm-changelog-version-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(2, 132, 199, 0.3);
    color: #38bdf8;
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 10px;
}

.sdm-changelog-content {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    max-height: 340px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #cbd5e1;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .sdm-title {
        font-size: 2rem;
    }
    .sdm-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .sdm-search-wrap {
        max-width: 100%;
        min-width: 100%;
    }
    .sdm-filter-pills {
        justify-content: center;
    }
    .sdm-grid {
        grid-template-columns: 1fr;
    }
    .sdm-faq-section {
        padding: 24px 18px;
    }
}
