/* 心晴日記 - Gradient Theme with White Text */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading overlay fade */
#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Force white text on gradient backgrounds */
#app-body {
    color: white;
}

/* Override Tailwind gray text colors - but not on buttons with backgrounds */
#welcome-screen h2,
#welcome-screen p:not(button *),
#welcome-greeting,
#write-diary-form h2,
#view-diary h2,
#edit-diary-form h2,
#happy-capsules-view h2,
#happy-capsules-view>p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Keep button text dark when button has white background */
button.bg-white,
button.bg-white * {
    color: #374151 !important;
}

/* Diary item in sidebar */
.diary-item {
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.diary-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.diary-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.diary-item-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diary-item-preview {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.diary-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Hashtag badges */
.hashtag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Capsule item */
.capsule-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 18px 20px;
}

.capsule-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.capsule-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

/* Toast */
.toast {
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.toast.success {
    background: #059669 !important;
}

.toast.error {
    background: #dc2626 !important;
}

.toast.warning {
    background: #d97706 !important;
}

/* No diaries text */
.no-diaries {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 32px 16px;
    font-size: 0.875rem;
}

/* Touch feedback for mobile */
@media (hover: none) {
    button:active {
        transform: scale(0.97);
    }
}

/* Ensure buttons are clickable on mobile */
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Glassmorphism for cards on gradient backgrounds */
/* Glassmorphism card */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Labels in forms */
label {
    color: rgba(255, 255, 255, 0.9) !important;
}

label span {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Print styles */
@media print {

    aside,
    header,
    button,
    .toast,
    #confirm-modal,
    #btn-write-diary-fab {
        display: none !important;
    }

    main {
        margin: 0;
        padding: 20px;
    }

    body {
        background: white !important;
        color: black !important;
    }
}