/*
 * wisнblower - Wish of the Day Component CSS
 * Minimalist search-engine inspired design
 */

/* ===== ANIMATED STARFIELD BACKGROUND ===== */
.background-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -97;
    display: block;
    pointer-events: none;
}

/* ===== WISHOFTHEDAY PAGE LAYOUT ===== */
.wishoftheday-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent;
}

.wishoftheday-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

/* ===== DATE DISPLAY ===== */
.date-display {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 300;
    color: white;
    text-align: center;
    margin-top: 0;
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .date-display {
        padding-top: 1.5rem;
        margin-bottom: calc(clamp(1rem, 2.5vh, 1.5rem) / 2);
    }
}

/* ===== APP CONTENT - NO BOX ===== */
.app-content {
    width: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.2rem, 3vh, 2rem);
    transition: all 0.4s ease-in-out;
}

/* ===== INPUT MODE ===== */
.input-mode {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vh, 1.5rem);
    align-items: center;
    min-height: 200px;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

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

.wish-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    color: #ffffff;
    resize: none;
    min-height: 56px;
    max-height: 200px;
    font-family: inherit;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
    line-height: 1.4;
}

.wish-input::-webkit-scrollbar {
    display: none;
}

.wish-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    text-align: center;
}

.wish-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ===== BUTTONS - MINIMAL STYLE ===== */
.wish-button {
    padding: 0.65rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: auto;
}

.wish-button.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.wish-button.primary:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.wish-button.primary:active {
    transform: translateY(0);
}

.wish-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.wish-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.wish-button:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.wish-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===== DISPLAY MODE ===== */
.display-mode {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    min-height: 200px;
    opacity: 0;
    animation: fadeInDown 0.5s ease-in-out forwards;
}

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

.wish-display-wrapper {
    width: 100%;
    position: relative;
}

.wish-display {
    width: 100%;
    padding: clamp(1rem, 2vw, 1.5rem);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    line-height: 1.6;
    color: #ffffff;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    font-weight: 300;
    min-height: 80px;
    margin: 0 auto;
    direction: ltr;
    animation: wishGlow 3s ease-in-out infinite;
}

.wish-display-edit {
    width: 100%;
    padding: clamp(1rem, 2vw, 1.5rem);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    line-height: 1.6;
    color: #ffffff;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    font-weight: 300;
    min-height: 80px;
    margin: 0 auto;
    direction: ltr;
    opacity: 0.8;
}

.wish-display-static {
    width: 100%;
    padding: clamp(1rem, 2vw, 1.5rem);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    line-height: 1.6;
    color: rgba(130, 130, 130, 1);
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
    font-weight: 300;
    min-height: 80px;
    margin: 0 auto;
    direction: ltr;
    text-shadow: 0 0 50px rgba(130, 130, 130, 1),
                 0 0 100px rgba(130, 130, 130, 1),
                 0 0 150px rgba(130, 130, 130, 0.8),
                 0 2px 8px rgba(0, 0, 0, 0.5);
}

.inactive-mode .edit-countdown {
    color: rgba(160, 160, 160, 0.8);
    font-size: 0.85rem;
    font-weight: 400;
    text-shadow: 0 0 10px rgba(160, 160, 160, 0.6);
}

.edit-icon {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.edit-icon::before {
    content: '✎';
    font-size: 1.1rem;
    color: #ffffff;
    font-style: normal;
}

.edit-icon:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%) scale(1.15);
}

.edit-icon:active {
    transform: translateX(-50%) scale(0.9);
}

@keyframes wishGlow {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    25% {
        opacity: 0.95;
        transform: scale(1.02);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4),
                     0 0 20px rgba(255, 255, 255, 0.25),
                     0 2px 8px rgba(0, 0, 0, 0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 40px rgba(255, 255, 255, 0.5),
                     0 0 60px rgba(255, 255, 255, 0.3),
                     0 2px 8px rgba(0, 0, 0, 0.5);
    }
    75% {
        opacity: 0.95;
        transform: scale(1.02);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4),
                     0 0 20px rgba(255, 255, 255, 0.25),
                     0 2px 8px rgba(0, 0, 0, 0.5);
    }
}

.edit-countdown {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-variant-numeric: tabular-nums;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.edit-countdown.active {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    animation: wishGlow 3s ease-in-out infinite;
}

/* ===== REFLECTION MODE ===== */
.reflection-mode {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    min-height: 200px;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

.reflection-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.reflection-buttons .wish-button {
    flex: 1 1 0;
    min-width: 180px;
    max-width: 220px;
}

/* ===== REACTION MODE ===== */
.reaction-mode {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.reaction-message {
    font-size: 2.5rem;
    font-weight: 300;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    animation: reactionFade 0.6s ease-in-out;
}

@keyframes reactionFade {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== STORAGE HINT ===== */
.storage-hint {
    transition: opacity 0.5s ease;
}

.storage-hint.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

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

/* Tablets */
@media (max-width: 768px) {
    .wishoftheday-container {
        padding: 1.5rem 1rem;
    }

    .wish-input {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }

    .wish-button {
        padding: 0.75rem 1.75rem;
        font-size: 0.9rem;
    }

    .reaction-message {
        font-size: 2rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .wishoftheday-container {
        padding: 1rem 0.75rem;
    }

    .date-display {
        margin-bottom: calc(clamp(1rem, 2.5vh, 1.5rem) / 2);
    }

    .wish-input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
        border-radius: 20px;
    }

    .wish-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    .reaction-message {
        font-size: 1.75rem;
    }

    .reflection-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .reflection-buttons .wish-button {
        width: auto;
        max-width: 280px;
        min-width: 200px;
    }

    .edit-countdown {
        font-size: 0.7rem;
    }
}

/* ===== ACCESSIBILITY ===== */

/* Focus states */
.wish-input:focus-visible {
    outline: none;
}

.wish-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wish-button,
    .reaction-message,
    .wish-display {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .wish-input {
        border: 2px solid rgba(255, 255, 255, 0.6);
    }

    .wish-button {
        border: 2px solid rgba(255, 255, 255, 0.6);
    }
}
