:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --background-color: #f9f9f9;
    --text-color: #333;
    --border-color: #ddd;
    --button-hover: #3a5a80;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 2rem;
    color: var(--primary-color);
}

#settings-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-display {
    text-align: center;
    margin-bottom: 10px;
}

.emoji-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    font-size: 3rem;
}

.emoji {
    cursor: help;
    transition: transform 0.2s;
    user-select: none;
}

.emoji:hover {
    transform: scale(1.2);
}

.story-area {
    margin: 20px 0;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
}

.story-area {
    margin: 20px 0;
    position: relative;
}

#history-toggle {
    display: block;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 1px;
    text-align: left;
}

#history-toggle:hover {
    text-decoration: underline;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.share-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.share-btn:hover {
    background-color: var(--button-hover);
}

.menu-btn {
    background-color: var(--background-color);
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.menu-btn:hover {
    background-color: var(--button-hover);
    color: var(--background-color);
}

.tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 80%;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #777;
}

.close-button:hover {
    color: #333;
}

.history-container {
    display: none;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.history-container h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.story-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-card {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    background-color: white;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.story-card-date {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.story-card-emojis {
    font-size: 1.5rem;
    margin: 10px 0;
}

.story-card-text {
    white-space: pre-wrap;
    line-height: 1.4;
}

.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: #777;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .emoji-container {
        font-size: 2.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 15px;
    }

    .menu-dropdown {
        right: 10px;
        min-width: 160px;
        top: 50px;
    }

    .menu-item {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

/* Menu dropdown */
.menu-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f5f5f5;
}
