/**
 * My Subscriptions Page Styles
 * Dark theme with clean interactions
 */

/* ===== Loading & Error States ===== */

.subscriptions-loading,
.subscriptions-error,
.subscriptions-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.subscriptions-loading p,
.subscriptions-error p,
.subscriptions-login-required p {
    color: #808080;
    margin: 16px 0 24px 0;
    max-width: 400px;
}

.subscriptions-error h2,
.subscriptions-login-required h2 {
    color: #ffffff;
    margin: 0;
    font-size: 24px;
}

.error-icon,
.login-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 24px;
}

.error-icon {
    background: rgba(239, 68, 68, 0.1);
}

.error-icon i {
    font-size: 48px;
    color: #ef4444;
}

.login-icon {
    background: rgba(74, 158, 255, 0.1);
}

.login-icon i {
    font-size: 48px;
    color: #4a9eff;
}

/* ===== Main Container ===== */

.my-subscriptions-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== Wallet Section ===== */

.wallet-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a2a1a 0%, #1a1a1a 100%);
    border: 1px solid #2a3a2a;
    border-radius: 12px;
    margin-bottom: 24px;
}

.wallet-section.low-balance {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1a1a 100%);
    border-color: #3a2a2a;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.wallet-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px;
}

.wallet-section.low-balance .wallet-icon {
    background: rgba(239, 68, 68, 0.15);
}

.wallet-icon i {
    font-size: 22px;
    color: #10b981;
}

.wallet-section.low-balance .wallet-icon i {
    color: #ef4444;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-label {
    font-size: 12px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-amount {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
}

.wallet-section.low-balance .wallet-amount {
    color: #ef4444;
}

.wallet-breakdown {
    font-size: 12px;
    color: #606060;
}

.wallet-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #ef4444;
}

.wallet-warning i {
    font-size: 14px;
}

.wallet-add-funds {
    flex-shrink: 0;
    width: auto;
    white-space: nowrap;
}

/* ===== Header ===== */

.subscriptions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #2a2a2a;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

.header-content h1 i {
    color: #ef4444;
}

.header-content p {
    margin: 0;
    font-size: 14px;
    color: #808080;
}

.header-stats {
    display: flex;
    gap: 24px;
}

.header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
}

.header-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #4a9eff;
}

.header-stat .stat-label {
    font-size: 12px;
    color: #808080;
}

.header-stat.suspended .stat-value {
    color: #ef4444;
}

/* ===== Subscriptions List ===== */

.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Subscription Card ===== */

.subscription-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.subscription-card.suspended {
    border-color: #3a2a2a;
    opacity: 0.9;
}

.suspended-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
}

.suspended-banner i {
    font-size: 16px;
}

.subscription-creator {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #161616;
    border-bottom: 1px solid #2a2a2a;
}

.subscription-creator .creator-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.subscription-creator .creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subscription-creator .creator-avatar i {
    font-size: 24px;
    color: #4a4a4a;
}

.subscription-creator .creator-info {
    flex: 1;
}

.subscription-creator .creator-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.subscription-creator .creator-username {
    margin: 0;
    font-size: 14px;
    color: #808080;
}

/* ===== Subscription Details ===== */

.subscription-details {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.detail-row + .detail-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #2a2a2a;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    color: #d0d0d0;
    font-weight: 500;
}

.detail-value.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border-radius: 6px;
    font-size: 13px;
    width: fit-content;
}

.detail-value.price {
    color: #4a9eff;
    font-weight: 600;
}

.detail-value.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    width: fit-content;
}

.detail-value.status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.detail-value.status.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.detail-value.status.paused {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.detail-value.status.suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ===== Subscription Renewal ===== */

.subscription-renewal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #141414;
}

.renewal-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.renewal-info > i {
    font-size: 20px;
    color: #4a9eff;
}

.renewal-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.renewal-status {
    font-size: 14px;
    font-weight: 500;
    color: #d0d0d0;
}

.renewal-status.cancelled {
    color: #ef4444;
}

.renewal-status.suspended {
    color: #ef4444;
}

.renewal-info.suspended > i {
    color: #ef4444;
}

.renewal-date {
    font-size: 12px;
    color: #808080;
}

.subscription-actions {
    display: flex;
    gap: 10px;
}

/* ===== Subscription Benefits ===== */

.subscription-benefits {
    padding: 16px 20px;
    border-top: 1px solid #2a2a2a;
    background: #161616;
}

.benefits-label {
    font-size: 12px;
    color: #808080;
    margin-right: 12px;
}

.benefits-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.benefit-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 12px;
    border-radius: 20px;
}

.benefit-tag i {
    font-size: 10px;
}

.benefit-tag.more {
    background: rgba(74, 158, 255, 0.1);
    color: #4a9eff;
}

/* ===== Empty State ===== */

.subscriptions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-illustration {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    margin-bottom: 32px;
}

.empty-illustration i {
    font-size: 56px;
    color: #ef4444;
    opacity: 0.8;
}

.subscriptions-empty h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: #ffffff;
}

.subscriptions-empty p {
    margin: 0 0 24px 0;
    font-size: 15px;
    color: #808080;
    max-width: 400px;
}

/* ===== Buttons ===== */

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-danger-outline {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Manage Modal Styles ===== */

.manage-subscription-modal {
    min-width: 400px;
}

.modal-creator-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.creator-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.creator-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-avatar-small i {
    font-size: 20px;
    color: #4a4a4a;
}

.modal-creator-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #ffffff;
}

.modal-creator-header p {
    margin: 0;
    font-size: 13px;
    color: #808080;
}

/* Modal Sections */

.modal-section {
    margin-bottom: 24px;
}

.modal-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.modal-section h4 i {
    color: #4a9eff;
    font-size: 13px;
}

/* Tier Selection Grid */

.tier-selection-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tier-option {
    display: block;
    cursor: pointer;
}

.tier-option input[type="radio"] {
    display: none;
}

.tier-option-content {
    padding: 14px 16px;
    background: #141414;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
}

.tier-option:hover .tier-option-content {
    border-color: #3a3a3a;
}

.tier-option input[type="radio"]:checked + .tier-option-content {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.05);
}

.tier-option.current .tier-option-content {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.tier-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tier-option-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.tier-option-header .current-badge {
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
}

.tier-option-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.tier-option-price .price {
    font-size: 18px;
    font-weight: 700;
    color: #4a9eff;
}

.tier-option-price .period {
    font-size: 13px;
    color: #808080;
}

.tier-option-price .price-diff {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.tier-option-price .price-diff.increase {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tier-option-price .price-diff.decrease {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tier-option-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tier-option-benefits span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #a0a0a0;
}

.tier-option-benefits span i {
    color: #10b981;
    font-size: 10px;
}

.tier-option-benefits span.more {
    color: #808080;
}

.modal-options {
    margin-bottom: 24px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-label {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.option-desc {
    font-size: 12px;
    color: #808080;
}

.modal-info-section h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.modal-info-section .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-info-section .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #141414;
    border-radius: 6px;
}

.modal-info-section .label {
    font-size: 11px;
    color: #808080;
    text-transform: uppercase;
}

.modal-info-section .value {
    font-size: 14px;
    color: #d0d0d0;
    font-weight: 500;
}

/* Toggle Switch */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #3a3a3a;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: #4a9eff;
}

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

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .my-subscriptions-page {
        padding: 16px;
    }

    .wallet-section {
        flex-wrap: wrap;
    }

    .wallet-info {
        flex: 1 1 100%;
    }

    .wallet-warning {
        flex: 1 1 100%;
    }

    .wallet-add-funds {
        width: auto;
        flex: 0 0 auto;
    }

    .subscriptions-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .header-stats {
        width: 100%;
        justify-content: center;
    }

    .subscription-creator {
        flex-wrap: wrap;
    }

    .subscription-creator .btn {
        width: 100%;
        margin-top: 12px;
    }

    .detail-row {
        grid-template-columns: 1fr 1fr;
    }

    .subscription-renewal {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .renewal-info {
        flex-direction: column;
    }

    .subscription-actions {
        width: 100%;
        justify-content: center;
    }

    .manage-subscription-modal {
        min-width: auto;
    }

    .modal-info-section .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .detail-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .subscription-actions {
        flex-direction: column;
    }

    .subscription-actions .btn {
        width: 100%;
    }
}
