/* ===== AI Analysis Progress Modal Styles ===== */

/* Modal backdrop */
.analysis-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Main modal container */
.analysis-modal {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 28px;
    padding: 0;
    width: 90%;
    max-width: 720px;
    box-shadow: var(--shadow-lg),
                0 0 60px rgba(11, 61, 145, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header section */
.modal-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 40px 45px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

.modal-title {
    margin: 0;
    color: white;
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    letter-spacing: -0.8px;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.modal-emoji {
    font-size: 40px;
    animation: bounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-18px) scale(1.1);
    }
}

/* Content area */
.modal-content {
    padding: 35px 40px;
    display: flex;
    gap: 35px;
    flex: 1;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
}

/* Progress section (left side) */
.progress-section {
    flex: 0 0 38%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
}

/* Circular progress indicator */
.progress-circle-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(77, 184, 168, 0.4));
    }
}

.progress-circle-bg {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 6px solid rgba(255, 255, 255, 0.25);
}

.progress-circle-fill {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color-success) 0deg,
        var(--color-accent) 120deg,
        var(--color-secondary) 240deg,
        rgba(255, 255, 255, 0.2) 360deg
    );
    border: 6px solid rgba(255, 255, 255, 0.3);
    transform: rotate(calc(-90deg + var(--progress-rotation, 0deg)));
    transition: transform 0.3s ease-out;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.15);
}

.progress-text {
    position: relative;
    z-index: 10;
    text-align: center;
}

.progress-percentage {
    font-size: 56px;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
                 0 0 20px rgba(255, 255, 255, 0.2);
    animation: scaleNumber 0.4s ease-out;
}

@keyframes scaleNumber {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.progress-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 8px;
    font-weight: 700;
}

/* Step indicator */
.step-indicator {
    text-align: center;
    width: 100%;
    padding: 0 10px;
}

.step-spinner {
    font-size: 36px;
    margin-bottom: 14px;
    animation: spinPulse 1.5s linear infinite;
}

@keyframes spinPulse {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

.step-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    min-height: 28px;
}

/* Tips section (right side) */
.tips-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Inspirational message section */
.inspirational-message {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    padding: 20px 18px;
    backdrop-filter: blur(20px);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.inspirational-text {
    color: white;
    font-size: 16px;
    font-style: italic;
    font-weight: 600;
    line-height: 1.8;
    text-align: center;
    margin: 0;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    animation: shimmerText 3s ease-in-out infinite;
}

@keyframes shimmerText {
    0%, 100% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 12px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 24px rgba(255, 255, 255, 0.25);
    }
}

.tips-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.tips-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 10px;
    max-height: 220px;
    min-height: 120px;
}

/* Custom scrollbar */
.tips-container::-webkit-scrollbar {
    width: 6px;
}

.tips-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.tips-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.tips-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Tip card */
.tip-card {
    background: rgba(255, 255, 255, 0.14);
    border: 1.2px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(20px);
    animation: slideInRight 0.5s ease-out forwards;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.tip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmerCard 2.5s infinite;
}

@keyframes shimmerCard {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tip-card:nth-child(1) { animation-delay: 0.1s; }
.tip-card:nth-child(2) { animation-delay: 0.2s; }
.tip-card:nth-child(3) { animation-delay: 0.3s; }
.tip-card:nth-child(4) { animation-delay: 0.4s; }
.tip-card:nth-child(5) { animation-delay: 0.5s; }

.tip-card:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.38);
    transform: translateX(6px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.tip-emoji {
    font-size: 20px;
    margin-right: 10px;
    display: inline-block;
    animation: floatEmoji 2s ease-in-out infinite;
}

@keyframes floatEmoji {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.tip-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
}

.tip-text strong {
    color: rgba(255, 215, 0, 0.9);
    font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .analysis-modal {
        width: 95%;
        max-width: 95%;
        border-radius: 24px;
    }

    .modal-header {
        padding: 30px 25px;
    }

    .modal-title {
        font-size: 26px;
    }

    .modal-content {
        flex-direction: column;
        padding: 25px 20px;
        gap: 25px;
    }

    .progress-section {
        flex: 1;
        gap: 22px;
    }

    .tips-section {
        max-height: 300px;
        gap: 15px;
    }

    .inspirational-message {
        min-height: 85px;
        padding: 16px;
    }

    .inspirational-text {
        font-size: 15px;
        line-height: 1.6;
    }

    .progress-circle-container {
        width: 140px;
        height: 140px;
    }

    .progress-circle-bg,
    .progress-circle-fill {
        width: 140px;
        height: 140px;
    }

    .progress-percentage {
        font-size: 44px;
    }

    .progress-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 24px 20px;
    }

    .modal-title {
        font-size: 22px;
        gap: 10px;
    }

    .modal-emoji {
        font-size: 32px;
    }

    .modal-content {
        padding: 20px 16px;
    }

    .progress-section {
        gap: 18px;
    }

    .progress-circle-container {
        width: 110px;
        height: 110px;
    }

    .progress-circle-bg,
    .progress-circle-fill {
        width: 110px;
        height: 110px;
    }

    .progress-percentage {
        font-size: 36px;
    }

    .tip-text {
        font-size: 12px;
    }
}
