/* ==========================================
   SiteRooster Dashboard — Upgrade Modal
   Prefix: sru- (SiteRooster Upgrade)
   Shows pricing tiers to free/trial users
   ========================================== */

/* Overlay */
.sru-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sru-overlay.sru-visible {
    display: flex;
    opacity: 1;
}

/* Modal */
.sru-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.sru-overlay.sru-visible .sru-modal {
    transform: translateY(0) scale(1);
}

/* Header */
.sru-header {
    background: linear-gradient(160deg, #0d1f1a 0%, #0a3328 40%, #065f46 100%);
    padding: 32px 36px 28px;
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.sru-header::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.12);
    pointer-events: none;
}

.sru-header::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
}

.sru-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s;
}

.sru-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sru-close svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2;
}

.sru-header-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6ee7b7;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.sru-header-label .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: sru-pulse 2s ease-in-out infinite;
}

@keyframes sru-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sru-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    position: relative;
    z-index: 1;
}

.sru-header h2 em {
    font-style: italic;
    color: #6ee7b7;
}

.sru-header p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

/* Billing Toggle */
.sru-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 36px 4px;
}

.sru-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
}

.sru-toggle-label.active {
    color: #1a1a2e;
}

.sru-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.sru-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sru-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.2s;
}

.sru-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sru-toggle-switch input:checked + .sru-toggle-slider {
    background: #059669;
}

.sru-toggle-switch input:checked + .sru-toggle-slider::before {
    transform: translateX(20px);
}

.sru-save-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Pricing Cards Grid */
.sru-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 36px 32px;
}

/* Individual Card */
.sru-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.sru-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sru-card.sru-popular {
    border-color: #059669;
    box-shadow: 0 0 0 1px #059669;
}

.sru-popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #059669;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.sru-plan-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 2px;
}

.sru-plan-tagline {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px;
}

/* Price */
.sru-price-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 2px;
}

.sru-currency {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    align-self: flex-start;
    margin-top: 4px;
}

.sru-amount {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.sru-period {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.sru-annual-total {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    margin-bottom: 0;
    min-height: 18px;
}

/* Features */
.sru-features {
    list-style: none;
    padding: 0;
    margin: 16px 0 20px;
    flex: 1;
}

.sru-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    padding: 4px 0;
    line-height: 1.4;
}

.sru-features li svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.sru-features .sru-feat-highlight {
    font-weight: 600;
}

.sru-features .sru-not-included {
    color: #9ca3af;
}

.sru-features .sru-not-included svg {
    color: #d1d5db;
}

/* CTA button */
.sru-cta-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sru-cta-btn:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
}

.sru-card.sru-popular .sru-cta-btn {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.sru-card.sru-popular .sru-cta-btn:hover {
    background: #047857;
    border-color: #047857;
}

/* Footer note */
.sru-footer {
    padding: 0 36px 24px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.sru-footer a {
    color: #059669;
    text-decoration: none;
}

.sru-footer a:hover {
    text-decoration: underline;
}

/* ==========================================
   CONFIRMATION SCREEN
   ========================================== */
.sru-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px 40px;
}

.sru-confirm-inner {
    text-align: center;
    max-width: 400px;
}

.sru-confirm-icon {
    margin-bottom: 16px;
}

.sru-confirm-inner h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.sru-confirm-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px;
}

.sru-confirm-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: 32px;
}

.sru-confirm-currency {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    align-self: flex-start;
    margin-top: 6px;
}

.sru-confirm-amount {
    font-size: 52px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.sru-confirm-period {
    font-size: 16px;
    color: #9ca3af;
    font-weight: 500;
    margin-left: 4px;
}

.sru-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.sru-confirm-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
    border: none;
    background: #059669;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.sru-confirm-btn:hover {
    background: #047857;
}

.sru-confirm-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.sru-confirm-btn.sru-loading {
    position: relative;
}

.sru-confirm-btn.sru-loading::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sru-spin 0.6s linear infinite;
}

@keyframes sru-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.sru-confirm-back {
    display: block;
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.sru-confirm-back:hover {
    border-color: #d1d5db;
    color: #374151;
}

.sru-confirm-fine {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* ==========================================
   SUCCESS SCREEN
   ========================================== */
.sru-success {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 36px 48px;
}

.sru-success-inner {
    text-align: center;
    max-width: 360px;
}

.sru-success-icon {
    margin-bottom: 20px;
    animation: sru-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sru-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.sru-success-inner h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.sru-success-inner p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px;
}

/* ---- Responsive ---- */

/* Context banners (credits exhausted / feature gated) */
.sru-context-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 36px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.sru-context-banner svg { flex-shrink: 0; }

.sru-context-credits {
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
}

.sru-context-feature {
    background: #eff6ff;
    color: #1e40af;
    border-bottom: 1px solid #bfdbfe;
}

@media (max-width: 720px) {
    .sru-context-banner {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .sru-modal {
        max-width: 100%;
        border-radius: 16px;
    }

    .sru-header {
        padding: 24px 20px 20px;
        border-radius: 16px 16px 0 0;
    }

    .sru-cards {
        grid-template-columns: 1fr;
        padding: 16px 20px 24px;
    }

    .sru-toggle-row {
        padding: 20px 20px 0;
    }

    .sru-footer {
        padding: 0 20px 20px;
    }

    .sru-confirm,
    .sru-success {
        padding: 32px 20px;
    }
}