/* Profile Page Styles */

.profile-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    padding: 120px 0 80px;
    position: relative;
}

.profile-layout {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
    padding: 0 20px; /* Add horizontal padding to prevent edge touching */
}

/* Sidebar Styles */
.profile-sidebar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 30px;
    width: 320px; /* Fixed width that accommodates both languages */
    flex-shrink: 0;
    height: fit-content;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #333;
}

.profile-avatar {
    margin-bottom: 15px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #000;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.avatar-circle .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-name {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.profile-username {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tier-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.tier-0 {
    background: #6c757d;
    color: #fff;
}

.tier-badge.tier-1 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.tier-badge.tier-2 {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
}

.tier-badge.tier-3 {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: #fff;
}

.tier-badge.tier-4 {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #000;
}

/* Navigation Styles */
.profile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-nav li {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ddd;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 0; /* Allow flex items to shrink if needed */
}

.nav-link:hover {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 140, 0, 0.2) 100%);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.nav-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.nav-text {
    flex-grow: 1; /* Allow text to take available space */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
}

/* Content Styles */
.profile-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 40px;
    flex: 1;
    min-height: 600px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.section-header h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.section-header p {
    color: #888;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #ffc107;
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.2);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content h3 {
    color: #ddd;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.stat-value.status-paid {
    color: #28a745;
}

.stat-value.status-unpaid {
    color: #6c757d;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #000;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
    transform: translateY(-2px);
}

.action-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.action-btn.danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
}

.action-btn.small {
    padding: 8px 15px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
    border: 1px solid #555;
}

.action-btn.small:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
    transform: translateY(-1px);
    color: #fff;
}

.action-btn.disabled {
    background: #333 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Subscription Card */
.subscription-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #444;
}

.sub-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.4rem;
}

.plan-status {
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-status.active {
    background: #28a745;
    color: #fff;
}

.plan-status.free {
    background: #6c757d;
    color: #fff;
}

.plan-details {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 25px;
}

.plan-info h4 {
    color: #ffc107;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.plan-price {
    color: #ddd;
    font-size: 1.1rem;
    margin: 0;
}

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

.plan-features li {
    color: #ddd;
    padding: 5px 0 5px 25px;
    position: relative;
}

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

.plan-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Billing Info */
.billing-info {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    padding: 30px;
}

.billing-info h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.billing-details {
    space-y: 15px;
}

.billing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #444;
}

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

.billing-item .label {
    color: #888;
    font-weight: 500;
}

.billing-item .value {
    color: #ddd;
    font-weight: 600;
}

.billing-item .value.status-active {
    color: #28a745;
}

/* Settings */
.settings-group {
    margin-bottom: 40px;
}

.settings-group h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    color: #ddd;
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-input {
    width: 100%;
    padding: 12px 15px;
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.setting-input.disabled {
    background: #1a1a2e;
    color: #888;
    cursor: not-allowed;
}

.setting-note {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    transition: 0.3s;
    border-radius: 25px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 17px;
    width: 17px;
    left: 4px;
    bottom: 4px;
    background: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: #ffc107;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.settings-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

/* Billing Table */
.billing-table {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 120px 1fr 100px 100px 100px;
    background: #1a1a2e;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.header-cell {
    color: #ffc107;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px 100px 100px;
    padding: 20px;
    border-bottom: 1px solid #444;
    align-items: center;
}

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

.table-cell {
    color: #ddd;
    font-size: 0.95rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-succeeded {
    background: #28a745;
    color: #fff;
}

.status-badge.status-failed {
    background: #dc3545;
    color: #fff;
}

.status-badge.status-pending {
    background: #ffc107;
    color: #000;
}

.status-badge.status-paid {
    background: #28a745;
    color: #fff;
}

.status-badge.status-open {
    background: #ffc107;
    color: #000;
}

.status-badge.status-void {
    background: #6c757d;
    color: #fff;
}

.status-badge.status-draft {
    background: #17a2b8;
    color: #fff;
}

.status-badge.status-uncollectible {
    background: #dc3545;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    color: #888;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Support Grid */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.support-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.support-card:hover {
    transform: translateY(-5px);
    border-color: #ffc107;
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.2);
}

.support-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.support-card h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.support-card p {
    color: #888;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
}

.faq-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.faq-items {
    space-y: 10px;
}

.faq-item {
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 193, 7, 0.1);
}

.faq-toggle {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 20px 20px;
    color: #ddd;
    line-height: 1.6;
    margin: 0;
}

/* Medium screens - adjust layout */
@media (max-width: 1200px) {
    .profile-layout {
        max-width: 1200px;
        gap: 30px; /* Reduce gap slightly */
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .profile-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .profile-sidebar {
        position: static;
        width: 100%;
        max-width: none; /* Remove max-width restriction on mobile */
        order: -1; /* Put sidebar first on mobile */
    }
    
    .profile-content {
        width: 100%; /* Ensure content takes full width */
        max-width: none;
    }
    
    .profile-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .nav-link {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        padding: 15px 10px;
    }
    
    .nav-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .profile-section {
        padding: 100px 0 60px; /* Remove horizontal padding, handled by layout */
    }
    
    .profile-layout {
        padding: 0 15px; /* Consistent horizontal padding */
    }
    
    .profile-content {
        padding: 20px;
    }
    
    .profile-sidebar {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.5rem; /* Smaller heading on mobile */
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px; /* Smaller gap on mobile */
    }
    
    .stat-card {
        padding: 20px; /* Smaller padding on mobile */
    }
    
    .plan-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .header-cell {
        display: none;
    }
    
    .table-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0; /* Add vertical padding for touch targets */
    }
    
    .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #ffc107;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-btn {
        justify-content: center;
        padding: 15px 20px; /* Larger touch targets */
        font-size: 1rem;
    }
    
    /* Better navigation on mobile */
    .profile-nav {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller mobile */
        gap: 8px;
    }
    
    .nav-link {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .profile-section {
        padding: 80px 0 40px; /* Remove horizontal padding */
    }
    
    .profile-layout {
        padding: 0 10px; /* Tighter but consistent padding */
    }
    
    .profile-content,
    .profile-sidebar {
        padding: 15px;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .profile-name {
        font-size: 1.1rem;
    }
    
    .tier-badge {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    
    /* Single column navigation on very small screens */
    .profile-nav {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 15px;
    }
    
    .nav-icon {
        margin-right: 10px;
        margin-bottom: 0;
        font-size: 1rem;
    }
    
    .action-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .subscription-card,
    .billing-info,
    .support-card {
        padding: 20px 15px;
    }
}

/* Plan Change Options Styles */
.plan-change-section {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 15px;
}

.plan-change-actions {
    text-align: center;
    margin: 20px 0;
}

.plan-options-grid {
    margin-top: 20px;
}

.plan-options-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-option-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f3a 100%);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plan-option-card:hover {
    transform: translateY(-5px);
    border-color: #ffc107;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.2);
}

.plan-option-card.upgrade {
    border-left: 4px solid #28a745;
}

.plan-option-card.downgrade {
    border-left: 4px solid #6c757d;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.plan-header h4 {
    color: #fff;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.plan-type-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-type-badge.upgrade {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.plan-type-badge.downgrade {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.plan-price {
    margin: 20px 0;
    text-align: center;
}

.plan-price .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffc107;
    line-height: 1;
}

.plan-price .period {
    font-size: 1rem;
    color: #888;
    margin-left: 5px;
}

.plan-features {
    margin: 20px 0;
}

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

.plan-features li {
    padding: 8px 0;
    color: #ddd;
    position: relative;
    padding-left: 25px;
}

.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.plan-action {
    text-align: center;
    margin-top: 25px;
}

.plan-action .action-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.plan-action .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #888;
}

.spinner {
    border: 3px solid #333;
    border-top: 3px solid #ffc107;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error-message {
    text-align: center;
    padding: 30px;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
}

.no-options {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

/* Responsive design for plan options */
@media (max-width: 768px) {
    .plan-options-wrapper {
        grid-template-columns: 1fr;
    }
    
    .plan-option-card {
        padding: 20px;
    }
    
    .plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .plan-type-badge {
        align-self: flex-end;
    }
}

/* Cancellation Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.cancel-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 25px;
}

.cancel-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.cancel-option {
    position: relative;
}

.cancel-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cancel-option label {
    display: block;
    padding: 20px;
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(42, 42, 62, 0.3);
}

.cancel-option input[type="radio"]:checked + label {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.cancel-option label strong {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 5px;
    display: block;
}

.cancel-option label p {
    color: #bbb;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.cancel-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.cancel-warning p {
    color: #ffc107;
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #333;
}

@media (max-width: 480px) {
    .cancel-modal {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .modal-footer .action-btn {
        width: 100%;
    }
    
    .cancel-options {
        gap: 15px;
    }
    
    .cancel-option label {
        padding: 15px;
    }
}

/* Plan Change Modal Styles */
.plan-change-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 15px;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.plan-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
}

.current-plan-info,
.new-plan-info {
    background: rgba(42, 42, 62, 0.3);
    border: 1px solid #444;
    border-radius: 10px;
    padding: 20px;
}

.current-plan-info h4,
.new-plan-info h4 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

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

.plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffc107;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 1.1rem;
    color: #ddd;
    margin-bottom: 10px;
}

.plan-tier {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arrow-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffc107;
    font-weight: bold;
}

.billing-info {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.billing-explanation {
    color: #ffc107;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.billing-explanation strong {
    color: #fff;
}

.plan-change-warning {
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.plan-change-warning p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Upgrade styling */
.plan-change-modal.upgrade .new-plan-info {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.plan-change-modal.upgrade .arrow-separator {
    color: #28a745;
}

.plan-change-modal.upgrade #confirmPlanChangeBtn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Downgrade styling */
.plan-change-modal.downgrade .new-plan-info {
    border-color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.plan-change-modal.downgrade .arrow-separator {
    color: #6c757d;
    transform: rotate(180deg);
}

.plan-change-modal.downgrade #confirmPlanChangeBtn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.plan-change-modal .modal-header {
    flex-shrink: 0;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
}

.plan-change-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 25px;
    min-height: 0; /* Allow flex item to shrink */
}

.plan-change-modal .modal-footer {
    flex-shrink: 0;
    padding: 20px 25px;
    border-top: 1px solid #333;
}

@media (max-width: 768px) {
    .plan-change-modal {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }
    
    .plan-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .arrow-separator {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }
    
    .plan-change-modal.downgrade .arrow-separator {
        transform: rotate(270deg);
    }
    
    .current-plan-info,
    .new-plan-info {
        padding: 15px;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    min-width: 320px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast.info .toast-icon {
    color: #17a2b8;
}

.toast-message {
    flex: 1;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Progress bar for auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    transform-origin: left;
    transition: transform linear;
}

.toast.success .toast-progress {
    background: #28a745;
}

.toast.error .toast-progress {
    background: #dc3545;
}

.toast.warning .toast-progress {
    background: #ffc107;
}

.toast.info .toast-progress {
    background: #17a2b8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Lazy Loading Placeholder Styles */
.placeholder-state {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #2a2a3e 0%, #26324e 100%);
    border: 1px solid #444;
    border-radius: 15px;
    color: #888;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.placeholder-state:hover {
    border-color: #ffc107;
    background: linear-gradient(135deg, #2e2e42 0%, #2a3652 100%);
}

.placeholder-state p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Loading state for lazy loaded content */
.loading-content {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.loading-content .spinner {
    margin: 0 auto 15px;
}

.loading-content p {
    margin: 0;
    font-size: 0.95rem;
}

/* Error state for failed lazy loads */
.error-content {
    text-align: center;
    padding: 40px 20px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 15px;
    color: #dc3545;
}

.error-content p {
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.error-content .action-btn {
    margin-top: 10px;
}

