/* Settings Page Styles */

.settings-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 3rem;
}

.settings-header h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.settings-header .subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

/* Loading state */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Settings sections */
.settings-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-content {
    padding: 2rem;
}

/* Info card styles */
.info-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.email-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.email-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1f2937;
}

.verification-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.verification-status.verified {
    background: #d1fae5;
    color: #065f46;
}

.verification-status.unverified {
    background: #fef3c7;
    color: #92400e;
}

.verification-actions {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 1rem;
}

.verification-message {
    color: #d97706;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* Form styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Membership card */
.membership-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.membership-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    pointer-events: none;
}

.membership-status {
    position: relative;
    z-index: 1;
}

.role-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.role-badge.administrator {
    background: rgba(252, 211, 77, 0.9);
    color: #92400e;
}

.role-badge.user {
    background: rgba(34, 197, 94, 0.9);
    color: #14532d;
}

.role-badge.trial {
    background: rgba(156, 163, 175, 0.9);
    color: #1f2937;
}

.role-badge.inactive {
    background: rgba(239, 68, 68, 0.9);
    color: #7f1d1d;
}

.membership-details p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.membership-text {
    font-weight: 500;
}

.expiry-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.membership-actions {
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-danger {
    border-color: #ef4444;
    color: #dc2626;
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Actions grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: left;
}

.action-btn .icon {
    font-size: 1.25rem;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.purchase-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.purchase-table th,
.purchase-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.purchase-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.purchase-table td {
    color: #6b7280;
    font-size: 0.875rem;
}

.purchase-table tr:hover {
    background: #f9fafb;
}

/* Stripe pricing table */
#stripePricingTable {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .settings-container {
        padding: 1rem;
    }
    
    .settings-header h1 {
        font-size: 2rem;
    }
    
    .section-header,
    .section-content {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .membership-card {
        padding: 1.5rem;
    }
    
    .email-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Animation for showing/hiding sections */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-1 {
    margin-top: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
}
.security-item {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
}

.session-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.session-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label {
    font-weight: 600;
    color: #495057;
}

.activity-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.activity-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.activity-success {
    color: #28a745;
}

.activity-failed {
    color: #dc3545;
}

.security-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.security-actions .btn {
    padding: 0.5rem 1rem;
}