/**
 * SUBSCRIPTION MODULE STYLES
 * Styles for the subscription management module
 */

/* Styles for the subscription badge */
.subscription-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: center;
    width: auto;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

/* Styles for the subscription management button */
.subscription-manage-button {
    margin-top: 10px;
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, 
                background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out, 
                box-shadow 0.15s ease-in-out;
}

/* Primary outline button */
.btn-outline-primary {
    color: #364D93;
    border-color: #364D93;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #364D93;
    border-color: #364D93;
}

/* Primary button */
.btn-primary {
    color: #fff;
    background-color: #364D93;
    border-color: #364D93;
}

.btn-primary:hover {
    color: #fff;
    background-color: #2c4082;
    border-color: #2c4082;
}

/* Styles for the subscription details section in modals */
.subscription-details-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.subscription-status-section h6 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #343a40;
}

.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-muted {
    color: #6c757d !important;
}

.small {
    font-size: 85%;
}

/* Styled alert */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* iOS specific styles */
.ios-specific-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    color: #fff;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
    margin-top: 15px;
}

.ios-specific-button img {
    height: 20px;
    margin-right: 8px;
}

/* Style for icons within texts */
i.fas, i.far, i.fa {
    margin-right: 5px;
}

/* Styles for the success modal */
.subscription-success-icon {
    color: #28a745;
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Subscription container styling */
.subscription-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* Mobile UI improvements */
@media (max-width: 576px) {
    .subscription-container {
        align-items: center;
    }
    
    .subscription-badge {
        margin-bottom: 10px;
    }
    
    .subscription-manage-button {
        width: 100%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        margin-bottom: 5px;
        width: 100%;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* Style for subscription plans */
.plans-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.plan-card {
    flex: 1 1 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 1px solid #e9ecef;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.plan-card.selected {
    border: 2px solid #364D93;
    background-color: rgba(54, 77, 147, 0.05);
}

.plan-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #364D93;
}

.plan-subtitle {
    color: #6c757d;
    margin-bottom: 20px;
}

.price-display {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.price-period {
    font-size: 0.9rem;
    color: #6c757d;
}

.popular-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #364D93;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.current-plan-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Active subscription badge with pulse animation */
.active-subscription {
    position: relative;
}

.active-subscription::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -3px;
    transform: translate(-100%, -50%);
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-100%, -50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    
    70% {
        transform: translate(-100%, -50%) scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    
    100% {
        transform: translate(-100%, -50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* iOS Payment Choice Modal Styles */
.ios-payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ios-payment-modal.show {
    opacity: 1;
    visibility: visible;
}

.ios-payment-modal-content {
    background-color: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.ios-payment-modal.show .ios-payment-modal-content {
    transform: translateY(0);
}

.ios-payment-modal-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    text-align: center;
}

.ios-payment-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.ios-payment-modal-body {
    padding: 24px;
}

.ios-payment-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-payment-option {
    background-color: #f8f9fa;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.ios-payment-option:hover {
    border-color: #364D93;
    background-color: rgba(54, 77, 147, 0.05);
}

.ios-payment-option.selected {
    border-color: #364D93;
    background-color: rgba(54, 77, 147, 0.1);
}

.ios-payment-option-icon {
    width: 40px;
    height: 40px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ios-payment-option-icon img {
    width: 24px;
    height: auto;
}

.ios-payment-option-info {
    flex: 1;
}

.ios-payment-option-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
    color: #333;
}

.ios-payment-option-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.ios-payment-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ios-payment-cancel-btn {
    background-color: transparent;
    color: #666;
    border: none;
    padding: 10px 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ios-payment-cancel-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.ios-payment-continue-btn {
    background-color: #364D93;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ios-payment-continue-btn:hover {
    background-color: #2c4082;
}

.ios-payment-continue-btn:disabled {
    background-color: #9aa5c4;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .ios-payment-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .ios-payment-modal-header {
        padding: 15px;
    }
    
    .ios-payment-modal-title {
        font-size: 1.3rem;
    }
    
    .ios-payment-modal-body {
        padding: 16px;
    }
    
    .ios-payment-option {
        padding: 12px;
    }
    
    .ios-payment-modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .ios-payment-cancel-btn,
    .ios-payment-continue-btn {
        width: 100%;
    }
}
