/**
 * Dashboard Conversion Optimization Styles
 * Research-backed design for maximum trial signup and upgrade conversion
 */

/* ========================================
   NAVIGATION BAR - TRIAL STATUS
   ======================================== */

.subscription-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Trial Status Badge */
.trial-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Default State - Free Tier */
.trial-status-badge.free {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
    border: 2px solid #34c759;
    box-shadow: none;
}

/* Trial Active State */
.trial-status-badge.trial {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

/* Trial Ending Soon (Last 24h) */
.trial-status-badge.urgent {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    animation: pulse-urgent 1s ease-in-out infinite;
}

/* Paid User State */
.trial-status-badge.paid {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.trial-icon {
    font-size: 18px;
    line-height: 1;
}

.trial-text {
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
}

/* Badge Animations */
@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(255, 149, 0, 0.6);
    }
}

@keyframes pulse-urgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 59, 48, 0.7);
    }
}

/* Usage Display */
.usage-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.usage-text {
    font-size: 15px;
    color: #3c3c43;
    font-weight: 600;
}

.usage-progress-container {
    width: 120px;
    height: 6px;
    background: #e5e5ea;
    border-radius: 3px;
    overflow: hidden;
}

.usage-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

/* Warning states for usage */
.usage-progress-bar.warning {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
}

.usage-progress-bar.danger {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
}

/* Primary CTA Button */
.primary-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Free Tier - Start Trial CTA */
.primary-cta.start-trial {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
    font-weight: 700;
}

.primary-cta.start-trial span {
    color: white !important;
}

.primary-cta.start-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(102, 126, 234, 0.5);
}

/* Trial Active - Upgrade CTA */
.primary-cta.upgrade {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.primary-cta.upgrade span {
    color: white !important;
}

.primary-cta.upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Trial Ending - Urgent CTA */
.primary-cta.urgent {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: white !important;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
    animation: pulse-button-urgent 1.5s ease-in-out infinite;
}

.primary-cta.urgent span {
    color: white !important;
}

.primary-cta.urgent:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.5);
}

@keyframes pulse-button-urgent {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 149, 0, 0.6);
    }
}

.cta-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.primary-cta:hover .cta-arrow {
    transform: translateX(3px);
}

/* ========================================
   CONVERSION BANNERS
   ======================================== */

.conversion-banners-container {
    position: relative;
    z-index: 100;
}

.conversion-banner {
    padding: 16px 24px;
    margin: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

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

/* Welcome Banner (First-Time User) */
.conversion-banner.welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Trial Activation Banner */
.conversion-banner.trial-active {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
}

/* Trial Ending Banner */
.conversion-banner.trial-ending {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: white;
}

/* Trial Last Day Banner */
.conversion-banner.trial-urgent {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    color: white;
    animation: pulse-banner 1.5s ease-in-out infinite;
}

@keyframes pulse-banner {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

.banner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.banner-title {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.banner-subtitle {
    font-size: 15px;
    opacity: 1;
    font-weight: 600;
    color: white;
}

.banner-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.banner-cta {
    padding: 10px 20px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.banner-cta:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

.banner-cta.primary {
    background: white;
    color: #667eea;
    border: none;
}

.banner-cta.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-dismiss {
    padding: 8px;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.banner-dismiss:hover {
    opacity: 1;
}

/* ========================================
   PROGRESS INDICATOR / CHECKLIST
   ======================================== */

.onboarding-checklist {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

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

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

.checklist-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.checklist-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #8e8e93;
    cursor: pointer;
    padding: 4px;
}

.checklist-progress {
    margin-bottom: 16px;
}

.progress-bar-container {
    height: 8px;
    background: #e5e5ea;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: #8e8e93;
    font-weight: 500;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f7;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.checklist-item.completed {
    background: #e8f5e9;
}

.checklist-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.checklist-item:not(.completed) .checklist-icon {
    border: 2px solid #c7c7cc;
    background: white;
    color: #c7c7cc;
}

.checklist-item.completed .checklist-icon {
    background: #34c759;
    color: white;
    border: none;
}

.checklist-text {
    flex: 1;
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

.checklist-item.completed .checklist-text {
    text-decoration: line-through;
    color: #8e8e93;
}

.checklist-cta {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checklist-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========================================
   SUCCESS CELEBRATION MODAL
   ======================================== */

.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

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

.celebration-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.celebration-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.celebration-title {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.celebration-message {
    font-size: 16px;
    color: #6e6e73;
    margin-bottom: 24px;
    line-height: 1.5;
}

.celebration-button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.celebration-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

@media (max-width: 768px) {
    .subscription-info {
        flex-wrap: wrap;
        gap: 12px;
    }

    .trial-status-badge {
        padding: 6px 12px;
        font-size: 12px;
    }

    .trial-icon {
        font-size: 16px;
    }

    .usage-display {
        order: 3;
        width: 100%;
    }

    .usage-progress-container {
        width: 100%;
    }

    .primary-cta {
        padding: 8px 16px;
        font-size: 14px;
    }

    .conversion-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        margin: 12px;
    }

    .banner-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .banner-cta {
        width: 100%;
        text-align: center;
    }

    .onboarding-checklist {
        width: calc(100% - 32px);
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    .trial-text {
        font-size: 11px;
    }

    .usage-text {
        font-size: 13px;
    }

    .primary-cta {
        font-size: 13px;
        padding: 8px 14px;
    }

    .cta-arrow {
        display: none;
    }

    .banner-title {
        font-size: 14px;
    }

    .banner-subtitle {
        font-size: 13px;
    }
}
