:root {
    --primary-blue: #3B82F6;
    --secondary-blue: #60A5FA;
    --text-dark: #1F2937;
    --text-medium: #4B5563;
    --text-light: #6B7280;
    --bg-light: #F9FAFB;
    --bg-card: #FFFFFF;
    --border-light: #E5E7EB;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    line-height: 1.6;
    margin: 0;
}

.container {
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 550px;
    text-align: center;
    overflow: hidden;
}

h1 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 700;
}

h3 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

#generate-mood-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

#generate-mood-btn:hover {
    background-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#generate-mood-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

#mood-display {
    background-color: var(--border-light);
    border-radius: 14px;
    padding: 35px 25px;
    text-align: center;
    transition: background-color 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

#mood-emoji {
    display: block;
    font-size: 90px;
    line-height: 1;
    margin-bottom: 10px;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#mood-display.active #mood-emoji {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}


#mood-text {
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--text-dark);
    margin: 15px 0 10px;
    font-weight: 700;
}

#mood-phrase {
    font-size: 17px;
    color: var(--text-medium);
    min-height: 1.2em;
    font-weight: 400;
}

.history-container {
    margin-top: 40px;
    text-align: left;
}

#mood-history-list {
    list-style-type: none;
    padding-left: 0;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
}

#mood-history-list::-webkit-scrollbar {
    width: 8px;
}

#mood-history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#mood-history-list::-webkit-scrollbar-thumb {
    background: var(--secondary-blue);
    border-radius: 10px;
}

#mood-history-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

.history-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left-width: 6px;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.history-item-emoji {
    font-size: 28px;
    margin-right: 15px;
}

.history-item-details {
    flex-grow: 1;
}

.history-item-details strong {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-dark);
    font-weight: 600;
}

.history-item-details p {
    font-size: 15px;
    color: var(--text-medium);
    margin: 5px 0 0;
}

.history-item-timestamp {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
    text-align: right;
    min-width: 120px;
}

@media (max-width: 600px) {
    .container {
        padding: 25px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    #generate-mood-btn {
        padding: 12px 20px;
        font-size: 16px;
        margin-bottom: 25px;
    }

    #mood-display {
        padding: 25px 15px;
        border-radius: 12px;
    }

    #mood-emoji {
        font-size: 70px;
    }

    #mood-text {
        font-size: 26px;
    }

    #mood-phrase {
        font-size: 15px;
    }

    h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .history-item {
        padding: 12px;
        border-radius: 8px;
        flex-wrap: wrap;
    }

    .history-item-emoji {
        font-size: 24px;
        margin-right: 10px;
    }

    .history-item-details {
        flex-basis: 100%;
        margin-top: 10px;
    }

    .history-item-timestamp {
        text-align: left;
        margin-top: 5px;
        min-width: auto;
    }
}