/* Paywall System Styles */

/* ===== Paywall Overlay ===== */
.paywalled {
    position: relative;
    filter: blur(5px);
    user-select: none;
}

.paywall-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.paywall-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.paywall-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.paywall-content h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #333;
}

.paywall-content p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 10px;
}

.current-plan {
    font-size: 0.9em;
    color: #999;
    margin-bottom: 20px;
}

.paywall-upgrade-btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paywall-upgrade-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* ===== Paywall Modal ===== */
.paywall-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.paywall-modal.active {
    opacity: 1;
}

.paywall-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.paywall-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    padding: 50px 40px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.modal-header p {
    font-size: 1.2em;
    opacity: 0.95;
}

.modal-body {
    padding: 40px;
}

.upgrade-context {
    background: #f5f7fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.context-message {
    font-size: 1.2em;
    color: #333;
    text-align: center;
    margin: 0;
    font-weight: 600;
}

.upgrade-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.upgrade-plan-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.upgrade-plan-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.upgrade-plan-card .plan-name {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.upgrade-plan-card .plan-price {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
}

.plan-features-compact {
    text-align: left;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
}

.plan-features-compact div {
    padding: 8px 0;
    font-size: 0.95em;
    color: #555;
}

.upgrade-plan-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-plan-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.modal-footer {
    padding: 20px 40px 40px;
    text-align: center;
}

/* ===== Paywall Notifications ===== */
.paywall-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.paywall-notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification-content {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.paywall-notification-info .notification-content {
    border-left: 4px solid #2196f3;
}

.paywall-notification-warning .notification-content {
    border-left: 4px solid #ff9800;
    background: #fff8e1;
}

.paywall-notification-error .notification-content {
    border-left: 4px solid #f44336;
    background: #ffebee;
}

.paywall-notification-success .notification-content {
    border-left: 4px solid #4caf50;
    background: #e8f5e9;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.notification-close:hover {
    color: #333;
}

/* ===== Usage Stats (Detailed View) ===== */
.usage-view {
    animation: fadeIn 0.5s ease;
}

.usage-header {
    text-align: center;
    margin-bottom: 40px;
}

.usage-header h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.usage-header p {
    font-size: 1.2em;
    color: #666;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.usage-stat-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.usage-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.stat-info h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
}

.stat-numbers {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.stat-numbers .used {
    font-size: 3em;
    font-weight: 700;
    color: #667eea;
}

.stat-numbers .separator {
    font-size: 2em;
    color: #ccc;
}

.stat-numbers .limit {
    font-size: 2em;
    font-weight: 700;
    color: #999;
}

.stat-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

.stat-bar-fill.success {
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
}

.stat-bar-fill.warning {
    background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
}

.stat-bar-fill.danger {
    background: linear-gradient(90deg, #f44336 0%, #e91e63 100%);
}

.stat-remaining {
    text-align: center;
    font-size: 0.95em;
    color: #666;
}

/* ===== Usage Warnings ===== */
.usage-warnings {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.usage-warnings h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.alert {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 1.1em;
}

.alert-warning {
    background: #fff8e1;
    border-left: 4px solid #ff9800;
    color: #663c00;
}

.alert-danger {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #7f0000;
}

.alert .btn-small {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* ===== Billing View ===== */
.billing-view {
    animation: fadeIn 0.5s ease;
}

.billing-view h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.billing-info {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.subscription-id {
    margin-top: 15px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
    font-family: monospace;
}

.billing-history {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.no-billing {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1em;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table thead {
    background: #f5f7fa;
}

.billing-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.billing-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.billing-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== Animations ===== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .paywall-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 40px 20px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .upgrade-plans {
        grid-template-columns: 1fr;
    }
    
    .usage-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .paywall-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .billing-table {
        font-size: 14px;
    }
    
    .billing-table th,
    .billing-table td {
        padding: 10px;
    }
    
    .alert {
        flex-direction: column;
        align-items: flex-start;
    }
}
