/**
 * Slatan License Manager — My Account Licenses CSS
 * Premium card-based layout for license management
 * All selectors scoped under #slm-my-licenses for specificity against themes
 */

/* ===== Header ===== */
#slm-my-licenses .slm-licenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#slm-my-licenses .slm-licenses-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #1e293b;
}

#slm-my-licenses .slm-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    color: #475569;
}

#slm-my-licenses .slm-refresh-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ===== Loading / Empty / Error states ===== */
#slm-my-licenses .slm-loading,
#slm-my-licenses .slm-empty,
#slm-my-licenses .slm-error {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 15px;
}

#slm-my-licenses .slm-error {
    color: #dc2626;
}

#slm-my-licenses .slm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: slm-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ===== License Card ===== */
#slm-my-licenses .slm-license-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
    box-shadow: none;
}

#slm-my-licenses .slm-license-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Card Header */
#slm-my-licenses .slm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

#slm-my-licenses .slm-card-product {
    display: flex;
    align-items: center;
    gap: 8px;
}

#slm-my-licenses .slm-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

#slm-my-licenses .slm-tier-badge {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    line-height: 1.6;
}

/* Status badges */
#slm-my-licenses .slm-status {
    display: inline-block;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: none;
    line-height: 1.6;
}

#slm-my-licenses .slm-status-active {
    background: #dcfce7;
    color: #166534;
}

#slm-my-licenses .slm-status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

#slm-my-licenses .slm-status-expired {
    background: #fef2f2;
    color: #991b1b;
}

/* License Key Row */
#slm-my-licenses .slm-card-key {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 14px;
}

#slm-my-licenses .slm-key-value {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: #334155;
    letter-spacing: 0.5px;
    word-break: break-all;
    background: none;
    padding: 0;
    border: none;
}

#slm-my-licenses .slm-btn-copy {
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    cursor: pointer;
    color: #64748b !important;
    transition: all 0.15s ease;
    line-height: 1;
    min-width: auto;
    min-height: auto;
    box-shadow: none !important;
    outline: none;
}

#slm-my-licenses .slm-btn-copy:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

#slm-my-licenses .slm-btn-copy.copied {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

#slm-my-licenses .slm-btn-copy .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: inherit !important;
    background: none !important;
    vertical-align: middle;
}

/* Info Row */
#slm-my-licenses .slm-card-info {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

#slm-my-licenses .slm-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#slm-my-licenses .slm-info-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

#slm-my-licenses .slm-info-value {
    font-size: 14px;
    color: #334155;
    font-weight: 600;
}

/* Domains */
#slm-my-licenses .slm-domains-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

#slm-my-licenses .slm-domain-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
    line-height: 1.6;
}

/* Domain Editor */
#slm-my-licenses .slm-domain-editor {
    margin-top: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

#slm-my-licenses .slm-domain-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#slm-my-licenses .slm-domain-input {
    flex: 1;
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13px;
    transition: border-color 0.15s ease;
    background: #fff !important;
    color: #334155 !important;
    height: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
}

#slm-my-licenses .slm-domain-input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

#slm-my-licenses .slm-btn-remove-domain {
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer;
    padding: 4px !important;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease;
    min-width: auto;
    min-height: auto;
    box-shadow: none !important;
}

#slm-my-licenses .slm-btn-remove-domain:hover {
    color: #ef4444 !important;
}

#slm-my-licenses .slm-domain-editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

#slm-my-licenses .slm-domain-save-group {
    display: flex;
    gap: 8px;
}

/* Actions Row */
#slm-my-licenses .slm-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ===== Buttons (high specificity to beat themes) ===== */
#slm-my-licenses .slm-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    padding: 7px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: #475569 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4 !important;
    min-width: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
}

#slm-my-licenses .slm-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
    text-decoration: none !important;
}

#slm-my-licenses .slm-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

#slm-my-licenses .slm-btn .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    vertical-align: middle;
    color: inherit !important;
    background: none !important;
    line-height: 1 !important;
}

#slm-my-licenses .slm-btn-primary {
    background: #3b82f6 !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
}

#slm-my-licenses .slm-btn-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

#slm-my-licenses .slm-btn-domains {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

#slm-my-licenses .slm-btn-regenerate {
    color: #dc2626 !important;
    border-color: #fecaca !important;
}

#slm-my-licenses .slm-btn-regenerate:hover {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
    color: #dc2626 !important;
}

#slm-my-licenses .slm-btn-download {
    background-color: #055CB2 !important;
    border-color: #055CB2 !important;
    color: #ffffff !important;
}

#slm-my-licenses .slm-btn-download:hover {
    background-color: #044789 !important;
    border-color: #044789 !important;
    color: #ffffff !important;
}

/* Notices */
#slm-my-licenses .slm-notice {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    animation: slm-slide-in 0.3s ease;
}

#slm-my-licenses .slm-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

#slm-my-licenses .slm-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes slm-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Renewal Modal ===== */
.slm-renew-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.slm-renew-overlay.slm-renew-visible {
    opacity: 1;
}

.slm-renew-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.slm-renew-visible .slm-renew-modal {
    transform: translateY(0) scale(1);
}

.slm-renew-close {
    position: absolute !important;
    top: 12px;
    right: 12px;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    line-height: 32px !important;
    text-align: center !important;
    cursor: pointer;
    color: #64748b !important;
    padding: 0 !important;
    transition: all 0.15s ease;
    z-index: 2;
    box-shadow: none !important;
}

.slm-renew-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
}

.slm-renew-header {
    text-align: center;
    padding: 28px 24px 16px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-bottom: 1px solid #bfdbfe;
}

.slm-renew-icon {
    display: inline-block !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 48px !important;
    color: #055CB2 !important;
    margin-bottom: 8px;
}

.slm-renew-title {
    margin: 0 0 4px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.slm-renew-product {
    margin: 0 0 4px !important;
    font-size: 14px !important;
    color: #055CB2 !important;
    font-weight: 600 !important;
}

.slm-renew-subtitle {
    margin: 0 !important;
    font-size: 13px !important;
    color: #64748b !important;
}

.slm-renew-body {
    padding: 20px 24px 24px;
}

.slm-renew-body .slm-loading {
    padding: 30px 20px;
}

.slm-renew-empty {
    text-align: center;
    padding: 30px 20px;
    color: #64748b;
    font-size: 14px;
}

/* Package Cards */
.slm-renew-packages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.slm-renew-package {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.slm-renew-package:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.slm-renew-package.slm-renew-selected {
    border-color: #055CB2;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(5, 92, 178, 0.12);
}

.slm-renew-package.slm-renew-selected::before {
    content: '\2713';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #055CB2;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    font-weight: 700;
}

.slm-renew-popular {
    border-color: #bfdbfe;
}

.slm-renew-popular-badge {
    position: absolute;
    top: -9px;
    left: 16px;
    padding: 1px 10px;
    background: linear-gradient(135deg, #055CB2, #1d7fe8);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.slm-renew-package-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.slm-renew-package-price {
    font-size: 15px;
    font-weight: 700;
    color: #055CB2;
}

.slm-renew-package-price del {
    color: #94a3b8;
    font-weight: 400;
    font-size: 13px;
}

.slm-renew-package-price ins {
    text-decoration: none;
}

/* Proceed Button */
#slm-renew-proceed,
#slm-upgrade-proceed {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background: #055CB2 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#slm-renew-proceed:hover:not(:disabled),
#slm-upgrade-proceed:hover:not(:disabled) {
    background: #044789 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 92, 178, 0.3);
}

#slm-renew-proceed:disabled,
#slm-upgrade-proceed:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Upgrade proceed button color override */
#slm-upgrade-proceed {
    background: #10B981 !important;
}

#slm-upgrade-proceed:hover:not(:disabled) {
    background: #059669 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Upgrade Modal Green Theme Overrides */
#slm-upgrade-overlay .slm-renew-header {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
    border-bottom: 1px solid #bbf7d0 !important;
}

#slm-upgrade-overlay .slm-renew-icon {
    color: #10B981 !important;
}

#slm-upgrade-overlay .slm-renew-product {
    color: #10B981 !important;
}

#slm-upgrade-overlay .slm-renew-package.slm-renew-selected {
    border-color: #10B981 !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}

#slm-upgrade-overlay .slm-renew-package.slm-renew-selected::before {
    background: #10B981 !important;
}

#slm-upgrade-overlay .slm-renew-package-price {
    color: #10B981 !important;
}

#slm-upgrade-overlay .slm-renew-popular-badge {
    background: linear-gradient(135deg, #10B981, #059669) !important;
}

/* Renew button style override */
#slm-my-licenses .slm-btn-renew:hover {
    background-color: #044789 !important;
    border-color: #044789 !important;
    color: #fff !important;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    #slm-my-licenses .slm-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #slm-my-licenses .slm-card-info {
        flex-direction: column;
        gap: 10px;
    }

    #slm-my-licenses .slm-card-actions {
        flex-direction: column;
    }

    #slm-my-licenses .slm-card-actions .slm-btn {
        width: 100%;
        justify-content: center;
    }

    #slm-my-licenses .slm-card-key {
        flex-wrap: wrap;
    }

    #slm-my-licenses .slm-domain-editor-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* Renewal modal responsive */
    .slm-renew-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .slm-renew-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .slm-renew-header {
        padding: 24px 16px 12px;
    }

    .slm-renew-body {
        padding: 16px;
    }

    .slm-renew-package {
        padding: 12px 14px;
    }
}