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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    min-height: 100vh;
    color: #e4e4e7;
    line-height: 1.6;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.date {
    color: #71717a;
    font-size: 0.95rem;
    font-weight: 400;
}

main {
    display: flex;
    flex-direction: column;
}

.diary-entry {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.diary-entry label {
    font-size: 0.875rem;
    color: #a1a1aa;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diary-textarea {
    height: 180px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    font-size: 1.1rem;
    color: #e4e4e7;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    line-height: 1.7;
    overflow-y: auto;
}

.diary-textarea:focus {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.diary-textarea:empty::before {
    content: "Dear diary...";
    color: #52525b;
    font-style: italic;
}

/* Fading character styles */
.diary-textarea span {
    transition: opacity 3s ease-out;
}

.diary-textarea span.fading {
    opacity: 0;
}

.save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.save-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

footer {
    text-align: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
    color: #52525b;
    font-size: 0.85rem;
}

/* Saved entries section */
.saved-entries {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    min-height: 0;
}

.saved-entries h2 {
    font-size: 1rem;
    font-weight: 500;
    color: #a1a1aa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entries-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 8px;
}

.no-entries {
    color: #52525b;
    font-style: italic;
    font-size: 0.9rem;
}

.entry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
}

.entry-card .entry-date {
    font-size: 0.75rem;
    color: #71717a;
    margin-bottom: 6px;
}

.entry-card .entry-text {
    font-size: 0.9rem;
    color: #d4d4d8;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Scrollbar styling */
.diary-textarea::-webkit-scrollbar,
.entries-list::-webkit-scrollbar {
    width: 8px;
}

.diary-textarea::-webkit-scrollbar-track,
.entries-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.diary-textarea::-webkit-scrollbar-thumb,
.entries-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.diary-textarea::-webkit-scrollbar-thumb:hover,
.entries-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .diary-textarea {
        height: 140px;
        padding: 16px;
        font-size: 1rem;
    }

    .container {
        padding: 16px;
    }
}
