/**
 * Subscription Pages CSS
 * Abonelik sayfaları için özel stiller
 *
 * @package AycaHanim
 */

/* ============== DEĞİŞKENLER ============== */
:root {
    --subscription-primary: var(--main-theme-color, #4f5ccc);
    --subscription-success: #28a745;
    --subscription-warning: #ffc107;
    --subscription-danger: #dc3545;
    --subscription-info: #17a2b8;
    --subscription-muted: #6c757d;
}

/* ============== CHECKOUT SAYFASI ============== */

.subscription-checkout-page {
    background: var(--body-bg, #f8f9fa);
    min-height: 100vh;
}

/* Ödeme Formu Kartı */
.checkout-form-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.checkout-form-title {
    font-weight: 600;
    color: var(--dark-color, #181c3d);
}

.checkout-secure-note {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

/* İyzico iframe */
#iyzipay-checkout-form iframe {
    border: none !important;
    width: 100%;
    min-height: 480px;
}

/* Sözleşme overlay */
#agreement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

#agreement-overlay .agreement-overlay-content {
    text-align: center;
    padding: 20px;
}

#agreement-overlay .agreement-overlay-content i {
    font-size: 2rem;
    color: var(--subscription-muted);
    margin-bottom: 10px;
    display: block;
}

#agreement-overlay .agreement-overlay-content p {
    color: var(--subscription-muted);
    font-weight: 600;
    margin: 0;
}

/* Sağ Sidebar (sticky) */
.checkout-sidebar {
    position: sticky;
    top: 80px;
}

/* Sipariş Özeti Kartı */
.order-summary-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.order-summary-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark-color, #181c3d);
    margin-bottom: 1.25rem;
    padding-bottom: 0;
}

/* Kurs bilgisi */
.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fb;
    border-radius: 14px;
    margin-bottom: 1.5rem;
}

.order-item-image {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.order-item-image-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--subscription-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.order-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color, #181c3d);
    margin-bottom: 0.15rem;
}

.order-item-subtitle {
    font-size: 0.8rem;
    color: var(--subscription-muted);
}

/* Fiyat satırları */
.order-details {
    margin-bottom: 1.25rem;
}

.order-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    font-size: 0.95rem;
    color: var(--dark-color, #181c3d);
}

.order-price-row + .order-price-row {
    border-top: 1px solid #f0f0f0;
}

/* Bugün Ödenecek vurgusu */
.order-today-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(79, 92, 204, 0.06) 0%, rgba(79, 92, 204, 0.02) 100%);
    border: 1.5px solid rgba(79, 92, 204, 0.15);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.order-today-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-color, #181c3d);
}

.order-today-price {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--subscription-primary);
}

/* Bilgi notu (kartın içinde) */
.order-info-note {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    background: #f8f9fb;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--subscription-muted);
    line-height: 1.5;
}

.order-info-note i {
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--subscription-primary);
    opacity: 0.6;
}

/* Sözleşme kutusu */
.subscription-agreement {
    background: var(--card-bg, #fff);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
}

.subscription-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--subscription-success) 0%, #34ce57 100%);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============== ABONELİKLERİM SAYFASI ============== */

.my-subscriptions-page {
    padding: 3rem 0;
}

.subscriptions-header {
    margin-bottom: 2rem;
}

.subscriptions-header h1 {
    font-weight: 700;
    color: var(--dark-color);
}

/* Filtre Tabları */
.subscription-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.subscription-tabs .nav-link {
    border-radius: 40px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    color: var(--subscription-muted);
    background: #f8f9fa;
    border: none;
    transition: all 0.3s ease;
}

.subscription-tabs .nav-link:hover {
    background: #e9ecef;
    color: var(--dark-color);
}

.subscription-tabs .nav-link.active {
    background: var(--subscription-primary);
    color: #fff;
}

.subscription-tabs .badge {
    margin-left: 0.5rem;
    font-size: 0.7rem;
}

/* Abonelik Kartı */
.subscription-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.subscription-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.subscription-card.status-active {
    border-left: 4px solid var(--subscription-success);
}

.subscription-card.status-past_due {
    border-left: 4px solid var(--subscription-danger);
}

.subscription-card.status-cancelled {
    border-left: 4px solid var(--subscription-muted);
    opacity: 0.8;
}

.subscription-card.status-expired {
    border-left: 4px solid var(--subscription-info);
    opacity: 0.8;
}

.subscription-card.status-pending {
    border-left: 4px solid var(--subscription-warning);
}

.subscription-course-image {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
}

.subscription-course-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.subscription-status-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.subscription-progress {
    margin: 1rem 0;
}

.subscription-progress .progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.subscription-progress-text {
    font-size: 0.85rem;
    color: var(--subscription-muted);
}

.subscription-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.subscription-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--subscription-muted);
}

.subscription-meta-item i {
    color: var(--subscription-primary);
}

.subscription-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============== ABONELİK DETAY SAYFASI ============== */

.subscription-detail-page {
    padding: 2rem 0;
}

.detail-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

.detail-stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.detail-stat small {
    display: block;
    margin-bottom: 0.25rem;
}

.detail-stat strong {
    font-size: 1.1rem;
    color: var(--dark-color);
}

.subscription-progress-detail .progress {
    height: 10px;
    border-radius: 5px;
    background: #e9ecef;
}

/* Ödeme Timeline */
.payments-timeline {
    position: relative;
}

.payment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--subscription-muted);
    flex-shrink: 0;
}

.payment-item.completed .payment-number {
    background: linear-gradient(135deg, var(--subscription-success) 0%, #34ce57 100%);
    color: #fff;
}

.payment-item.failed .payment-number {
    background: linear-gradient(135deg, var(--subscription-danger) 0%, #e85c5c 100%);
    color: #fff;
}

.payment-item.pending .payment-number {
    background: #fff;
    border: 2px dashed var(--subscription-muted);
}

.payment-content {
    flex: 1;
}

.payment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Tarih Kartı */
.date-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.date-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ============== BAŞARI / HATA SAYFALARI ============== */

.subscription-success-page,
.subscription-failure-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.result-card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.result-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
}

.result-icon.success {
    background: linear-gradient(135deg, #d4edda 0%, #b8e0c2 100%);
    color: var(--subscription-success);
}

.result-icon.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: var(--subscription-danger);
}

.result-card h1 {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.result-card .lead {
    color: var(--subscription-muted);
    margin-bottom: 2rem;
}

.subscription-info-box {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.subscription-info-box h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--subscription-muted);
}

.info-value {
    font-weight: 600;
    color: var(--dark-color);
}

/* ============== BOŞ DURUM ============== */

.empty-subscriptions {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 20px;
}

.empty-subscriptions i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-subscriptions h4 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-subscriptions p {
    color: var(--subscription-muted);
    margin-bottom: 1.5rem;
}

/* ============== İPTAL MODAL ============== */

#cancelModal .modal-content {
    border-radius: 20px;
    border: none;
}

#cancelModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#cancelModal .modal-footer {
    border-top: none;
    padding-top: 0;
}

/* ============== KURS DETAY - ABONELİK FİYAT ============== */

.rui-subscription-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--subscription-success) 0%, #34ce57 100%);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.rui-subscription-total {
    margin-top: 0.5rem;
}

/* ============== ADMİN FORM - ÖDEME MODELİ ============== */

.payment-model-option {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-model-option:hover {
    border-color: var(--subscription-primary);
    background: rgba(79, 92, 204, 0.02);
}

.payment-model-option .form-check-input:checked ~ .form-check-label {
    color: var(--subscription-primary);
}

.payment-model-option:has(.form-check-input:checked) {
    border-color: var(--subscription-primary);
    background: rgba(79, 92, 204, 0.05);
}

.model-icon {
    opacity: 0.7;
}

.payment-model-option:has(.form-check-input:checked) .model-icon {
    opacity: 1;
}

.subscription-total {
    border: 2px dashed var(--subscription-primary);
}

/* ============== RESPONSIVE ============== */

@media (max-width: 991.98px) {
    .checkout-sidebar {
        position: static;
    }

    .checkout-form-card {
        padding: 1rem;
    }

    #iyzipay-checkout-form iframe {
        min-height: 400px;
    }

    .subscription-card {
        padding: 1rem;
    }

    .subscription-course-image {
        width: 80px;
        height: 50px;
    }

    .subscription-meta {
        gap: 1rem;
    }

    .result-card {
        padding: 2rem;
    }

    .result-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .subscription-tabs {
        justify-content: center;
    }

    .subscription-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .subscription-card .d-flex {
        flex-direction: column;
    }

    .subscription-course-image {
        width: 100%;
        height: 150px;
        margin-bottom: 1rem;
    }

    .subscription-actions {
        justify-content: stretch;
    }

    .subscription-actions .btn {
        flex: 1;
    }

    .detail-stat {
        padding: 0.75rem;
    }

    .detail-stat strong {
        font-size: 1rem;
    }
}

/* ============== DARK MODE ============== */

.theme-dark .subscription-card,
.theme-dark .detail-card,
.theme-dark .result-card,
.theme-dark .order-summary-card,
.theme-dark .checkout-form-card,
.theme-dark .subscription-agreement {
    background: var(--dark-bg, #1e2139);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .order-item,
.theme-dark .order-info-note {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .order-today-total {
    background: rgba(79, 92, 204, 0.12);
    border-color: rgba(79, 92, 204, 0.25);
}

.theme-dark .order-price-row + .order-price-row {
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .order-item-title,
.theme-dark .order-today-label {
    color: #fff;
}

.theme-dark #agreement-overlay {
    background: rgba(30, 33, 57, 0.88);
}

.theme-dark .subscription-course-title,
.theme-dark .checkout-form-title,
.theme-dark .order-summary-title,
.theme-dark .detail-stat strong,
.theme-dark .result-card h1,
.theme-dark .info-value {
    color: #fff;
}

.theme-dark .subscription-tabs .nav-link {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.theme-dark .subscription-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.theme-dark .empty-subscriptions {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .payment-item {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .date-item {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .subscription-info-box {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .detail-stat {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .payment-model-option {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .payment-model-option:hover {
    border-color: var(--subscription-primary);
    background: rgba(79, 92, 204, 0.1);
}
