/* Variables */
:root {
    --primary-color: #667eea;
    --hover-bg: #f8f9fa;
    --text-color: #333;
    --border-color: #e0e0e0;
    --white: #ffffff;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* Header and Navigation */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

/* Footer */
footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Links */
a {
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #5568d3;
    color: var(--white);
}

/* Card/List Items */
.item-list {
    list-style: none;
}

.item-list li {
    padding: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.item-list li:hover {
    background-color: var(--hover-bg);
    border-left-color: var(--primary-color);
}

/* Home Page Specific */
.home-hero {
    text-align: center;
    padding: 4rem 0 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.home-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.home-hero .subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 2rem;
    font-weight: 300;
}

.home-hero p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Apps Section */
.apps-section {
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.apps-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.app-list {
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.app-list li {
    border-bottom: 1px solid var(--border-color);
}

.app-list li:last-child {
    border-bottom: none;
}

.app-list a {
    display: block;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.app-list a:hover {
    background-color: var(--hover-bg);
    border-left-color: var(--primary-color);
}

.app-list strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.app-list span {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

/* Login Prompt */
.login-prompt {
    text-align: center;
    padding: 3rem 0;
}

.login-prompt p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Search */
.search-form {
    max-width: 600px;
    margin: 2rem auto;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-form input[type="submit"] {
    margin-top: 1rem;
}

.search-results {
    list-style: none;
}

.search-results li {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-results h3 {
    margin-bottom: 0.5rem;
}

.search-results a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.search-results a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Rich Text Content */
.rich-text h1,
.rich-text h2,
.rich-text h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.rich-text p {
    margin-bottom: 1rem;
}

.rich-text ul,
.rich-text ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.rich-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Journal Page */
.journal-page {
    max-width: 900px;
    margin: 0 auto;
}

.journal-page h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.journal-page h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* New Entry Form */
.journal-new-entry {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.journal-new-entry h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.journal-new-entry .form-group {
    margin-bottom: 1rem;
}

.journal-new-entry label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.journal-new-entry textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.journal-new-entry textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.journal-new-entry textarea::placeholder {
    color: #999;
}

.journal-new-entry .btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.journal-new-entry .btn-primary:hover {
    background-color: #5568d3;
}

/* Journal Entries */
.journal-entries {
    margin-top: 3rem;
}

.journal-entries h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.journal-entry {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.journal-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.entry-timestamp {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.entry-content {
    color: var(--text-color);
    line-height: 1.8;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.entry-content h1 {
    font-size: 2rem;
}

.entry-content h2 {
    font-size: 1.5rem;
}

.entry-content h3 {
    font-size: 1.25rem;
}

.entry-content p {
    margin-bottom: 1rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.entry-content a:hover {
    border-bottom-color: var(--primary-color);
}

.entry-content code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
}

.entry-content pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.entry-content pre code {
    background-color: transparent;
    padding: 0;
}

.entry-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #666;
    font-style: italic;
}

/* Empty State */
.journal-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.journal-empty p {
    font-size: 1.1rem;
}
