/**
 * Subscription System Styles
 */

/* Subscription Modal Container */
#subscription-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

#subscription-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#subscription-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 16px 16px 0 0;
}

.subscription-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #1e293b;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Page Content */
.subscription-page {
    padding: 24px;
}

/* Form Styles */
.subscription-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Error Message */
.error-message {
    padding: 12px 14px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
    text-align: center;
}

.loading-message {
    padding: 12px 14px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
    text-align: center;
}

/* Payment Info */
.payment-info {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payment-info p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #475569;
}

.payment-info strong {
    color: #1e293b;
}

/* PayPal Container */
.paypal-container {
    margin: 20px 0;
}

#paypal-button-container {
    min-height: 50px;
}

/* Action Buttons */
.subscription-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-subscribe,
.btn-cancel {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-subscribe {
    background: #3b82f6;
    color: white;
}

.btn-subscribe:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-subscribe:active {
    transform: translateY(0);
}

.btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

.btn-cancel:hover {
    background: #cbd5e1;
}

/* Notes */
.subscription-note,
.payment-note,
.success-message,
.error-message {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 16px;
}

.remember-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #334155;
}

.remember-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.link-button {
    background: transparent;
    color: #2563eb;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.link-button:hover {
    color: #1d4ed8;
}

.subscription-note strong,
.payment-note strong,
.success-message strong,
.error-message strong {
    color: #1e293b;
}

/* Success Page */
.success-page {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.success-page h2 {
    color: #16a34a;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.success-page p {
    color: #475569;
    margin: 8px 0;
}

/* Error Page */
.error-page {
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.error-page h2 {
    color: #dc2626;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.error-page p {
    color: #475569;
    margin: 8px 0;
}

/* Cancel Page */
.cancel-page {
    text-align: center;
}

.cancel-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fef3c7;
    color: #f59e0b;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cancel-page h2 {
    color: #f59e0b;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.cancel-page p {
    color: #475569;
    margin: 8px 0;
}

/* Admin Users Management */
.admin-users-section {
    display: none;
}

.admin-users-section.show {
    display: block;
}

.users-settings {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-save-settings {
    background: #3b82f6;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-settings:hover {
    background: #2563eb;
}

/* Users Table */
.users-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.users-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.users-table th {
    padding: 14px;
    text-align: right;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.users-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.users-table tbody tr:hover {
    background: #f8fafc;
}

.users-table td {
    padding: 14px;
    font-size: 0.9rem;
    color: #475569;
}

.users-table td.email {
    color: #3b82f6;
    word-break: break-all;
}

.users-table td.status-active {
    color: #16a34a;
    font-weight: 600;
}

.users-table td.status-inactive {
    color: #dc2626;
    font-weight: 600;
}

.users-table td.status-pending {
    color: #f59e0b;
    font-weight: 600;
}

/* User Actions */
.user-actions {
    display: flex;
    gap: 8px;
}

.btn-toggle,
.btn-delete,
.btn-renew {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle {
    background: #dbeafe;
    color: #1e40af;
}

.btn-toggle:hover {
    background: #bfdbfe;
}

.btn-toggle.active {
    background: #dcfce7;
    color: #166534;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fecaca;
}

.btn-renew {
    background: #fef3c7;
    color: #92400e;
}

.btn-renew:hover {
    background: #fde68a;
}

/* Responsive */
@media (max-width: 640px) {
    #subscription-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .subscription-header h2 {
        font-size: 1.1rem;
    }

    .users-table {
        font-size: 0.8rem;
    }

    .users-table th,
    .users-table td {
        padding: 8px 4px;
    }

    .user-actions {
        flex-direction: column;
        gap: 4px;
    }

    .btn-toggle,
    .btn-delete,
    .btn-renew {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}
