/*
 * wisнblower - Wash Your Wish Component CSS
 * Water-themed glassmorphism design with animated background
 */

/* ===== ANIMATED WATER BACKGROUND ===== */
.washyourwish-page::before {
    content: '';
    position: fixed;
    top: -3%;
    left: -3%;
    width: 106%;
    height: 106%;
    background: url('../wbpics/bubbles_bg.jpg') center/cover no-repeat;
    z-index: -1;
    animation: waterSway 25s ease-in-out infinite;
}

@keyframes waterSway {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(0.8%, -0.4%) scale(1.005);
    }
    50% {
        transform: translate(-0.5%, 0.8%) scale(1.003);
    }
    75% {
        transform: translate(-0.8%, -0.4%) scale(1.007);
    }
}

/* ===== PAGE LAYOUT ===== */
.washyourwish-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent;
    position: relative;
    overflow-x: hidden;
}

.washyourwish-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vh, 3rem) 1.25rem;
}

/* ===== GLASSMORPHISM CARD ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: none;
    border-radius: 24px;
    padding: clamp(2rem, 5vw, 2.5rem);
    max-width: 600px;
    width: 100%;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
}

/* ===== SCREEN SYSTEM ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ===== HEADER ===== */
.wash-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vh, 2rem);
}

.wash-header h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--color-primary, #00b4d8);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.wash-header h1 .cyrillic-h {
    font-weight: 300;
}

.wash-header .tagline {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
    opacity: 0.9;
    color: var(--color-text-light, #023e8a);
}

/* ===== INPUT GROUP ===== */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(202, 240, 248, 0.5);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    color: #023e8a;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00b4d8;
    background: rgba(255, 255, 255, 0.95);
}

.input-group input::placeholder {
    color: rgba(2, 62, 138, 0.5);
}

/* Textarea styling for wish input */
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(202, 240, 248, 0.5);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    color: #023e8a;
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.input-group textarea:focus {
    outline: none;
    border-color: #00b4d8;
    background: rgba(255, 255, 255, 0.95);
}

.input-group textarea::placeholder {
    color: rgba(2, 62, 138, 0.5);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #48cae4 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    background: rgba(255, 255, 255, 0.15);
    color: #00b4d8;
    border: 2px solid #00b4d8;
    padding: 10px 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.btn-back:hover:not(:disabled) {
    background: #00b4d8;
    color: white;
    backdrop-filter: none;
}

.btn-back:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-start {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
}

/* ===== OPTIONS LIST ===== */
.options-list {
    margin-bottom: 1.25rem;
    min-height: 100px;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(240, 249, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 8px;
    color: #023e8a;
}

.option-item span {
    flex: 1;
    word-break: break-word;
}

.btn-delete {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

/* ===== STATS ===== */
.stats {
    text-align: center;
    margin: 1.25rem 0;
    padding: 15px;
    background: rgba(240, 244, 255, 0.8);
    border-radius: 10px;
    color: #00b4d8;
    font-weight: 600;
}

.warning {
    color: #ff8800;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ===== HISTORY SECTION ===== */
.history-section {
    margin-top: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header h3 {
    color: #00b4d8;
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    font-weight: 700;
    margin: 0;
    text-shadow:
        1px 1px 3px rgba(255, 255, 255, 0.9),
        -1px -1px 3px rgba(255, 255, 255, 0.9),
        1px -1px 3px rgba(255, 255, 255, 0.9),
        -1px 1px 3px rgba(255, 255, 255, 0.9);
}

.history-footer {
    text-align: center;
    margin-top: 1rem;
}

.history-item {
    background: rgba(240, 249, 255, 0.8);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.history-item:hover {
    border-color: #00b4d8;
    background: rgba(255, 255, 255, 0.95);
}

.history-item-content {
    flex: 1;
}

.history-item-title {
    font-weight: 400;
    color: #023e8a;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.history-item-winner {
    font-size: 0.95rem;
    font-weight: 600;
    color: #023e8a;
}

.history-item-date {
    font-size: 0.8rem;
    color: #023e8a;
    margin-top: 4px;
}

.history-item-delete {
    background: transparent;
    border: none;
    color: #023e8a;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.history-item-delete:hover {
    background: #ff4444;
    color: white;
}

/* ===== COMPARISON SCREEN ===== */
.comparison-question {
    text-align: center;
    margin-bottom: 1.25rem;
    color: #00b4d8;
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    font-weight: 700;
    text-shadow:
        1px 1px 3px rgba(255, 255, 255, 0.9),
        -1px -1px 3px rgba(255, 255, 255, 0.9),
        1px -1px 3px rgba(255, 255, 255, 0.9),
        -1px 1px 3px rgba(255, 255, 255, 0.9);
}

.progress-info {
    text-align: center;
    margin-bottom: 1.25rem;
}

.progress-info p {
    color: #023e8a;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(202, 240, 248, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b4d8 0%, #48cae4 100%);
    transition: width 0.4s ease;
}

.comparison-container {
    display: flex;
    gap: clamp(1rem, 3vw, 1.25rem);
    margin-top: clamp(1.5rem, 4vh, 2rem);
}

.comparison-card {
    flex: 1;
    padding: clamp(2rem, 8vw, 2.5rem) clamp(1rem, 4vw, 1.25rem);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px solid transparent;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    color: #023e8a;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-card:hover {
    transform: translateY(-5px);
    border-color: #00b4d8;
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.3);
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #48cae4 100%);
    color: white;
    animation: ripple 0.6s ease;
}

.comparison-card.selected {
    animation: pulse 0.3s ease;
    border-color: #00b4d8;
    box-shadow: 0 8px 30px rgba(0, 180, 216, 0.4);
}

.comparison-card.washed-away {
    animation: washAway 0.9s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    pointer-events: none;
    border-color: rgba(0, 180, 216, 0.3);
}

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

@keyframes washAway {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0) brightness(1);
    }
    12% {
        opacity: 0.92;
        transform: scale(1.09);
        filter: blur(0.5px) brightness(1.1);
    }
    20% {
        opacity: 0.85;
        transform: scale(1.15);
        filter: blur(1px) brightness(1.2);
        box-shadow:
            0 0 15px rgba(0, 180, 216, 0.4),
            inset 0 0 10px rgba(255, 255, 255, 0.5);
    }
    28% {
        opacity: 0.78;
        transform: scale(1.12);
        filter: blur(1.5px) brightness(1.18);
    }
    35% {
        opacity: 0.7;
        transform: scale(1.08);
        filter: blur(2px) brightness(1.15);
    }
    45% {
        opacity: 0.55;
        transform: scale(1.15);
        filter: blur(4px) brightness(1.28);
        box-shadow:
            0 0 25px rgba(0, 180, 216, 0.5),
            inset 0 0 18px rgba(255, 255, 255, 0.65);
    }
    60% {
        opacity: 0.35;
        transform: scale(1.25);
        filter: blur(6px) brightness(1.4);
        box-shadow:
            0 0 35px rgba(0, 180, 216, 0.6),
            inset 0 0 25px rgba(255, 255, 255, 0.8);
    }
    75% {
        opacity: 0.18;
        transform: scale(1.32);
        filter: blur(9px) brightness(1.5);
    }
    88% {
        opacity: 0.06;
        transform: scale(1.37);
        filter: blur(11px) brightness(1.58);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
        filter: blur(12px) brightness(1.6);
        box-shadow:
            0 0 50px rgba(0, 180, 216, 0),
            inset 0 0 40px rgba(255, 255, 255, 0);
    }
}

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.4);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(0, 180, 216, 0);
    }
}

/* ===== COMPARISON CONTROLS ===== */
.comparison-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: clamp(2rem, 5vh, 2.5rem);
}

.comparison-controls .btn-back,
.comparison-controls .btn-cancel {
    flex: 0 1 auto;
    min-width: 120px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.15);
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
    padding: 10px 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.btn-cancel:hover:not(:disabled) {
    background: #ff6b6b;
    color: white;
    backdrop-filter: none;
}

/* ===== RESULT SCREEN ===== */
.result-container {
    text-align: center;
    padding: 1.25rem;
}

.result-subtitle {
    color: #00b4d8;
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    text-shadow:
        1px 1px 3px rgba(255, 255, 255, 0.9),
        -1px -1px 3px rgba(255, 255, 255, 0.9),
        1px -1px 3px rgba(255, 255, 255, 0.9),
        -1px 1px 3px rgba(255, 255, 255, 0.9);
}

.result-container h2 {
    color: #023e8a;
    margin-bottom: clamp(1.5rem, 4vh, 2rem);
    font-size: clamp(1.3rem, 4vw, 1.5rem);
}

.winner {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #48cae4 100%);
    color: white;
    padding: clamp(1.5rem, 4vw, 2rem) clamp(1.5rem, 5vw, 2rem);
    border-radius: 20px;
    margin: clamp(1.5rem, 4vh, 2rem) 0;
    box-shadow:
        0 10px 30px rgba(0, 180, 216, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.winner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.winner h2.winner-label {
    color: white;
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    text-transform: lowercase;
}

.winner h3 {
    font-size: clamp(1.6rem, 5vw, 2rem);
    position: relative;
    z-index: 1;
    margin: 0 0 1rem 0;
    word-break: break-word;
}

.winner .btn-back {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
    margin-top: 0.5rem;
}

.winner .btn-back:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #00b4d8;
}

.back-button {
    text-align: center;
    margin-top: clamp(1.25rem, 3vh, 1.5rem);
}

/* ===== RANKING MODAL ===== */
.ranking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.ranking-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 3rem 2rem 2rem 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ranking-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #023e8a;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.ranking-modal-close:hover {
    background: #ff4444;
    color: white;
}

.ranking-modal-content h3 {
    display: none;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    background: rgba(240, 249, 255, 0.9);
    border-radius: 10px;
    color: #023e8a;
}

.ranking-item-position {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00b4d8;
    min-width: 40px;
}

.ranking-item-content {
    flex: 1;
}

.ranking-item-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.ranking-item-score {
    font-size: 0.9rem;
    color: #023e8a;
}

/* Highlight winner (#1) */
.ranking-item:first-child {
    background: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #48cae4 100%);
    color: white;
}

.ranking-item:first-child .ranking-item-position,
.ranking-item:first-child .ranking-item-score {
    color: white;
}

/* ===== CONFIRMATION MODAL ===== */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.confirm-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.confirm-modal-content h3 {
    color: #023e8a;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.confirm-modal-content p {
    color: #023e8a;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
}

.btn-danger {
    background: #ff4444;
    border-color: #cc0000;
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
    border-color: #990000;
}

/* ===== INFO BUTTON ENHANCEMENT ===== */
/* Pulse animation on page load (3 times) with color transition */
@keyframes infoPulse {
    0%, 100% {
        transform: scale(1);
        background: transparent;
        border-color: rgba(255, 255, 255, 0.4);
        color: rgba(255, 255, 255, 0.8);
    }
    50% {
        transform: scale(2);
        background: transparent;
        border-color: rgba(255, 255, 255, 1);
        color: #023e8a;
    }
}

.washyourwish-page .info-button {
    animation: infoPulse 1s ease-in-out 3;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }

    .comparison-container {
        flex-direction: column;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input,
    .btn {
        width: 100%;
    }
}
