:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --accent-color: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --card-bg: #2d2d2d;
    --border-color: #444;
    --accent-color: #adb5bd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
    padding: 0;
    margin: 0;
}

.header {
    background-color: var(--card-bg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.journal-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dropdown-container {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.entry-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236c757d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.entry-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.2);
}

.entry-content {
    padding: 1.5rem;
    min-height: 300px;
}

.entry-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

.entry-content .date {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: block;
}

.placeholder-text {
    text-align: center;
    padding: 2rem 0;
    color: var(--accent-color);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: rgba(108, 117, 125, 0.1);
}

.sun-icon, .moon-icon {
    transition: var(--transition);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    position: absolute;
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    position: absolute;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.entry-content p {
    margin-bottom: 1.8em; /* Creates double spacing between paragraphs */
    line-height: 1.6;    /* Maintains readable line height within paragraphs */
}

.entry-content p:last-child {
    margin-bottom: 0;    /* Removes extra space after last paragraph */
}

.entry-content > p {
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1.8em;
    line-height: 1.6;
    hyphens: auto; /* Optional: improves justification on wider screens */
}

/* Prevent justification on mobile where it looks awkward */
@media (max-width: 600px) {
    .entry-content > p {
        text-align: left;
        hyphens: none;
    }
}

.entry-content > p:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .header {
        padding: 1.2rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .container {
        margin: 1.5rem auto;
    }
    
    .dropdown-container {
        padding: 1rem;
    }
    
    .entry-select {
        padding: 0.7rem;
    }
    
    .entry-content {
        padding: 1.2rem;
    }
}