/* ==========================================
   CRUMP AI v2.12.0 - NEW FEATURES CSS
   Add this to your existing styles.css
   ========================================== */

/* ==========================================
   TIER BADGE (Header)
   ========================================== */
.tier-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tier-badge:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.tier-icon {
    font-size: 14px;
}

.tier-name {
    color: var(--accent-primary);
}

/* ==========================================
   UPGRADE MODAL
   ========================================== */
.upgrade-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;
}

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

.upgrade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.upgrade-content {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.upgrade-modal.active .upgrade-content {
    transform: scale(1);
}

.upgrade-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.upgrade-close:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

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

.upgrade-header h2 {
    font-size: 32px;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.upgrade-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

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

.tier-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    transition: all 0.3s ease;
}

.tier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tier-card.featured {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(212, 175, 55, 0.1) 100%);
    transform: scale(1.05);
}

.tier-card.featured:hover {
    transform: scale(1.08) translateY(-4px);
}

.tier-card.current {
    border-color: var(--success);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.current-badge {
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-top: 8px;
}

.tier-header {
    text-align: center;
    margin-bottom: 24px;
}

.tier-icon-large {
    font-size: 48px;
    margin-bottom: 12px;
}

.tier-header h3 {
    font-size: 24px;
    color: var(--accent-primary);
    margin-bottom: 0;
}

.tier-price {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.price-amount {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-primary);
}

.price-period {
    font-size: 16px;
    color: var(--text-secondary);
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.tier-features li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.tier-features li:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 18px;
    min-width: 24px;
}

.tier-button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tier-button.primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.tier-button.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.tier-button.secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tier-button.secondary:hover {
    background: var(--bg-secondary);
}

.tier-button.disabled {
    background: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.upgrade-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.upgrade-footer p {
    margin: 8px 0;
}

.maybe-later-btn {
    display: block;
    margin: 24px auto 0;
    padding: 12px 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maybe-later-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ==========================================
   USAGE STATS MODAL
   ========================================== */
.usage-stats-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;
}

.usage-stats-modal.active {
    opacity: 1;
}

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

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.modal-content h2 {
    text-align: center;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.tier-info {
    text-align: center;
    margin-bottom: 32px;
}

.tier-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-primary);
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-icon {
    font-size: 20px;
}

.stat-label {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.5s ease;
    border-radius: 4px;
}

.stat-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.stat-numbers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.stat-used {
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-separator {
    color: var(--text-tertiary);
}

.stat-limit {
    color: var(--text-secondary);
}

.stat-warning {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 12px;
    color: #f59e0b;
    text-align: center;
}

.upgrade-cta {
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(212, 175, 55, 0.1));
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.upgrade-cta p {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--text-primary);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* ==========================================
   CODE BLOCKS (Syntax Highlighting)
   ========================================== */
.code-block-wrapper {
    background: #1e1e1e;
    border-radius: 8px;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Inline code */
code:not([class*="language-"]) {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
}

/* ==========================================
   TIMEOUT PROGRESS INDICATOR
   ========================================== */
.timeout-progress {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 768px) {
    .tier-comparison {
        grid-template-columns: 1fr;
    }
    
    .tier-card.featured {
        transform: scale(1);
    }
    
    .tier-card.featured:hover {
        transform: scale(1.02) translateY(-4px);
    }
    
    .upgrade-content {
        padding: 24px;
    }
    
    .tier-price {
        padding-bottom: 16px;
    }
    
    .price-amount {
        font-size: 36px;
    }
}
