/**
 * Cobalt AMS v13.14.0 — Billing & Upgrade Styles (PH-4)
 */

/* ============================================
   TRIAL BANNER
   ============================================ */

.trial-banner {
    position: relative;
    z-index: 100;
}

.trial-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 0;
    font-size: 13px;
}

.trial-info { color: #1e40af; }
.trial-info .trial-banner-content { background: #eff6ff; border-bottom: 1px solid #bfdbfe; color: #1e40af; }
.trial-warning .trial-banner-content { background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e; }
.trial-urgent .trial-banner-content { background: #fef2f2; border-bottom: 1px solid #fecaca; color: #991b1b; }

.trial-upgrade-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
}

.trial-upgrade-btn:hover {
    background: #d94d20;
}

.trial-dismiss-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    opacity: 0.5;
    color: inherit;
}

.trial-dismiss-btn:hover { opacity: 1; }

/* ============================================
   VEHICLE LIMIT BADGE
   ============================================ */

.vehicle-limit-badge {
    display: none;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.limit-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.limit-reached {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ============================================
   PLAN COMPARISON MODAL
   ============================================ */

#upgradePlanModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.upgrade-modal-inner {
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    max-width: 860px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 32px;
}

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

.upgrade-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900, #1f2937);
    margin: 0 0 8px 0;
}

.upgrade-modal-header p {
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    margin: 0;
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--gray-100, #f3f4f6);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.billing-toggle-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted, #6b7280);
    transition: all 0.2s;
}

.billing-toggle-btn.active {
    background: var(--bg-primary, #fff);
    color: var(--gray-900, #1f2937);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.billing-save-badge {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Plan Cards */
.plan-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.plan-card {
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    padding: 24px 20px;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
    background: var(--bg-primary, #fff);
}

.plan-card:hover {
    border-color: var(--gray-300, #d1d5db);
}

.plan-highlight {
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(241, 90, 41, 0.15);
}

.plan-highlight:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.plan-current {
    border-color: #059669;
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 10px;
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-600, #4b5563);
    white-space: nowrap;
}

.plan-badge-accent {
    background: #2563eb;
    color: #fff;
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0 4px;
    color: var(--gray-900, #1f2937);
}

.plan-price {
    font-size: 28px;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 2px;
}

.plan-annual-note {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.plan-details {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700, #374151);
}

/* Plan Buttons */
.plan-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.plan-btn-upgrade {
    background: #2563eb;
    color: #fff;
}

.plan-btn-upgrade:hover {
    background: #d94d20;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 90, 41, 0.3);
}

.plan-btn-current {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-500, #6b7280);
    cursor: default;
}

/* ============================================
   FEATURE GATE OVERLAY
   ============================================ */

#featureGateOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.feature-gate-card {
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.feature-gate-icon {
    margin-bottom: 16px;
}

.feature-gate-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900, #1f2937);
    margin: 0 0 8px;
}

.feature-gate-card p {
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ============================================
   BILLING STATUS BADGES
   ============================================ */

.billing-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: 4px;
}

.billing-status.active {
    background: #ecfdf5;
    color: #059669;
}

.billing-status.trialing {
    background: #eff6ff;
    color: #2563eb;
}

.billing-status.past-due {
    background: #fef2f2;
    color: #dc2626;
}

.billing-status.canceled {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .plan-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .upgrade-modal-inner {
        padding: 20px;
    }
}
