/* Base Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    width: 100%;
    max-width: 900px;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 0.75rem;
        max-width: none;
    }
    
    .modal-header {
        padding: 1rem 1rem 0 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 0 1rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 0.25rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
        max-height: 98vh;
    }
    
    .modal-header {
        padding: 0.75rem 0.75rem 0 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subscription Modal Styles */
.subscription-modal-content {
    max-width: 900px;
    width: 95%;
}

/* .subscription-status {
    margin-bottom: 2rem;
} */

.status-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 25%, #667eea 50%, #f093fb 75%, #f5576c 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.status-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: capitalize;
}

.plan-status {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.plan-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-details p {
    margin: 0.5rem 0;
}

/* Plan status styling */
.plan-status {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    margin: 0.5rem 0;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Improved colors for better readability */
.plan-status.limited-access {
    color: #1e293b !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.plan-status.premium-user {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

.plan-status.subscription-expired {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* Responsive adjustments for subscription plans */
@media (max-width: 1024px) {
    .subscription-plans {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .subscription-plans {
        gap: 12px;
        margin: 12px 0;
    }
}

.plan-card {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

/* Responsive adjustments for plan cards */
@media (max-width: 768px) {
    .plan-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .plan-header h3 {
        font-size: 1.3rem;
    }
    
    .plan-price .price {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .plan-card {
        padding: 1.25rem;
        border-radius: 10px;
    }
    
    .plan-header h3 {
        font-size: 1.2rem;
    }
    
    .plan-price .price {
        font-size: 2rem;
    }
    
    .plan-features li {
        font-size: 0.9rem;
        padding: 0.4rem 0;
    }
}

.plan-card.popular {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.plan-card.best-value {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.plan-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-card.best-value .plan-badge {
    background: #10b981;
}

.plan-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.plan-price {
    margin-bottom: 0.5rem;
}

.plan-price .price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
}

.plan-price .currency {
    font-size: 1rem;
    color: #64748b;
    margin-left: 0.5rem;
}

.plan-savings {
    color: #10b981;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.plan-features li {
    padding: 0.5rem 0;
    color: #475569;
    position: relative;
    padding-left: 1.5rem;
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.plan-select-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-select-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.plan-card.popular .plan-select-btn {
    background: #f59e0b;
}

.plan-card.popular .plan-select-btn:hover {
    background: #d97706;
}

.plan-card.best-value .plan-select-btn {
    background: #10b981;
}

.plan-card.best-value .plan-select-btn:hover {
    background: #059669;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
    .plan-select-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .plan-select-btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Payment History */
.payment-history-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

.payment-history-section h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
}

.payment-history {
    max-height: 100vh;
    overflow-y: auto;
}

.payment-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    align-items: center;
}

.payment-plan {
    font-weight: 600;
    color: #1e293b;
}

.payment-amount {
    font-weight: 600;
    color: #059669;
}

.payment-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.payment-status.completed {
    background: #dcfce7;
    color: #166534;
}

.payment-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.payment-status.failed {
    background: #fee2e2;
    color: #991b1b;
}

.payment-date {
    color: #64748b;
    font-size: 0.875rem;
}

.no-payment-history {
    text-align: center;
    color: #64748b;
    padding: 2rem;
    font-style: italic;
}

/* Subscription Required Modal */
.subscription-required-content {
    max-width: 500px;
}

.subscription-required-message {
    text-align: center;
    padding: 2rem 0;
}

.icon-container {
    margin-bottom: 1.5rem;
}

.icon-container svg {
    color: #3b82f6;
}

.subscription-required-message h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.5rem;
}

.subscription-required-message p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.free-access-note {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.free-access-note p {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
}

#upgrade-now-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#upgrade-now-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* User dropdown subscription icon */
#subscription-link svg {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Mobile subscription link */
#mobile-subscription-link svg {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
}

/* Subscription status indicator in navigation */
.subscription-indicator {
    position: relative;
}

.subscription-indicator.premium::after {
    content: '★';
    position: absolute;
    top: -2px;
    right: -2px;
    color: #f59e0b;
    font-size: 0.75rem;
}

/* RTL Styles for Subscription */
[dir="rtl"] .plan-features li {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] .plan-features li::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .plan-price .currency {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] #subscription-link svg,
[dir="rtl"] #mobile-subscription-link svg {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .plan-card {
        padding: 1.5rem;
    }
    
    .plan-price .price {
        font-size: 2rem;
    }
    
    .payment-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .subscription-modal-content {
        width: 98%;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Loading states */
.plan-select-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.plan-select-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Premium user indicator */
.user-premium {
    position: relative;
}

.user-premium::after {
    content: '⭐';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
}

/* Free access lock indicator on disease cards */
.disease-card.locked,
.disease-group-card.locked {
    position: relative;
    opacity: 0.7;
}

.disease-card.locked::after,
.disease-group-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    z-index: 10; /* Ensure it appears above other content */
}

.disease-card.free-access::after,
.disease-group-card.free-access::after {
    display: none; /* Removed free emoji for cleaner UI */
}

/* Payment success/error messages */
.payment-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.payment-message.success {
    background: #10b981;
}

.payment-message.error {
    background: #ef4444;
}

.payment-message.warning {
    background: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
