/* Modern Modal Styles */
:root {
    --modal-backdrop: rgba(15, 23, 42, 0.8);
    --modal-bg: rgba(248, 250, 252, 0.95);
    --modal-bg-dark: rgba(30, 41, 59, 0.95);
    --modal-border: rgba(148, 163, 184, 0.2);
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --modal-radius: 24px;
    --modal-padding: 2rem;
    --modal-max-width: 500px;
    --modal-animation-duration: 0.4s;
    --modal-animation-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --modal-backdrop: rgba(0, 0, 0, 0.8);
    --modal-bg: rgba(30, 41, 59, 0.95);
    --modal-border: rgba(148, 163, 184, 0.2);
}

/* Base Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 100;
    transition: opacity var(--modal-animation-duration) var(--modal-animation-ease);
}

.modal.show {
    opacity: 100;
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: var(--modal-radius);
    padding: var(--modal-padding);
    width: 95%;
    max-width: var(--modal-max-width);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--modal-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(20px) scale(0.95);
    transition: all var(--modal-animation-duration) var(--modal-animation-ease);
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .modal-content {
    background: var(--modal-bg-dark);
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(148, 163, 184, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s var(--modal-animation-ease);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

/* Modal Headers */
.modal h2 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    padding-right: 3rem;
}

.modal h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Modal Text */
.modal p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Login Modal Specific */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.login-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s var(--modal-animation-ease);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .login-option-btn {
    background: rgba(30, 41, 59, 0.8);
}

.login-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-option-btn:hover::before {
    left: 100%;
}

.login-option-btn:hover {
    background: rgba(74, 144, 226, 0.05);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
}

.login-option-btn:active {
    transform: translateY(0);
}

.login-option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-option-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Plan Selection Modal */
.plan-modal {
    max-width: 1000px;
    width: 95%;
}

.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.plan-card {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--modal-border);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s var(--modal-animation-ease);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .plan-card {
    background: rgba(30, 41, 59, 0.9);
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.4s var(--modal-animation-ease);
}

.plan-card:hover::before {
    transform: scaleX(1);
}

.plan-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(74, 144, 226, 0.2);
    border-color: var(--accent);
}

.plan-card.apoio {
    border-color: var(--accent);
    position: relative;
    background: rgba(74, 144, 226, 0.02);
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.1);
}

[data-theme="dark"] .plan-card.apoio {
    background: rgba(74, 144, 226, 0.05);
}

.plan-card.apoio::after {
    content: '⭐ MAIS POPULAR';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    color: white;
    padding: 0.6rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0 0 16px 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.plan-header h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 2.5rem;
    padding: 1rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.period {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-features {
    text-align: left;
    margin-bottom: 2.5rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(34, 197, 94, 0.1);
    transform: translateX(4px);
}

.feature .material-symbols-sharp {
    color: #22c55e;
    font-size: 1.3rem;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.3rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.feature span:last-child {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.select-plan-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s var(--modal-animation-ease);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
    position: relative;
    overflow: hidden;
}

.select-plan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.select-plan-btn:hover::before {
    left: 100%;
}

.select-plan-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.4);
}

.select-plan-btn:active {
    transform: translateY(-1px);
}

.select-plan-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success/Loading Modals */
.success-content,
.waiting-content {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem !important;
    color: #22c55e;
    margin-bottom: 1.5rem;
    display: block;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 144, 226, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.plan-activated {
    background: rgba(34, 197, 94, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    backdrop-filter: blur(10px);
}

/* User Menu Modal */
.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(10px);
}

.user-details h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.user-details p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.plan-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 1px solid rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.plan-status:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.15);
}

.plan-status .material-symbols-sharp {
    font-size: 2rem;
    color: var(--accent);
    background: rgba(74, 144, 226, 0.1);
    padding: 0.8rem;
    border-radius: 12px;
}

.plan-details {
    flex: 1;
}

.plan-details strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.plan-details small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--modal-border);
}

.modal .btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 2px solid var(--modal-border);
    cursor: pointer;
    transition: all 0.3s var(--modal-animation-ease);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .modal .btn {
    background: rgba(30, 41, 59, 0.8);
}

.modal .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.modal .btn:hover::before {
    left: 100%;
}

.modal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.modal .btn.primary {
    background: var(--gradient);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.modal .btn.primary:hover {
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.modal .btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.modal .btn.danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Upgrade Modal Specific */
.upgrade-content {
    margin: 2rem 0;
}

.current-plan-info {
    background: rgba(148, 163, 184, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.current-plan-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.current-plan-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-list {
    background: rgba(34, 197, 94, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.feature-list h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.feature-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --modal-padding: 1.5rem;
        --modal-radius: 20px;
    }
    
    .modal-content {
        width: 98%;
        margin: 1%;
        max-height: 95vh;
    }
    
    .plan-modal {
        width: 98%;
    }
    
    .plans-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .plan-card {
        padding: 2rem;
    }
    
    .amount {
        font-size: 2.8rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .modal .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .login-option-btn {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .close-modal {
        top: 0.8rem;
        right: 0.8rem;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .modal h2 {
        font-size: 1.5rem;
        padding-right: 2.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --modal-padding: 1rem;
    }
    
    .plan-card {
        padding: 1.5rem;
    }
    
    .amount {
        font-size: 2.5rem;
    }
    
    .feature {
        padding: 0.6rem;
        gap: 0.8rem;
    }
    
    .feature span:last-child {
        font-size: 0.9rem;
    }
    
    .select-plan-btn {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .user-info {
        padding: 1rem;
    }
    
    .plan-status {
        padding: 1rem;
        gap: 0.8rem;
    }
}

/* Animation for modal entrance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal.show .modal-content {
    animation: modalFadeIn var(--modal-animation-duration) var(--modal-animation-ease);
}

/* Enhanced accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: flex;
}

/* Focus management */
.modal-content:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* =========================================
   ESTILOS DO MODAL DE DOAÇÃO
   ========================================= */

.donation-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
}

.donation-tabs .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.donation-tabs .tab-btn.active {
    background: var(--bg-primary);
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.donation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.donation-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.donation-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.15);
}

.donation-btn.custom {
    grid-column: span 2;
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
}

.donation-btn.custom:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modal-content,
    .plan-card,
    .login-option-btn,
    .modal .btn {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .success-icon {
        animation: none;
    }
}