@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;700&family=Source+Sans+Pro:wght@400;700&display=swap');

/* 
  Morning Brew Inspired Design
  - Lora for headings (serif)
  - Source Sans Pro for body (sans-serif)
*/

:root {
    /* Light Mode (Default) */
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --primary-color: #111827; /* A dark gray for accents */
    --secondary-color: #4B5563; /* A lighter gray for subtext */
    --border-color: #E5E7EB;
    --input-bg-color: #F9FAFB;
    --button-bg-color: #000000;
    --button-text-color: #FFFFFF;
    --font-serif: 'Lora', serif;
    --font-sans: 'Source Sans Pro', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111827;
        --text-color: #FFFFFF;
        --primary-color: #D1D5DB;
        --secondary-color: #9CA3AF;
        --border-color: #374151;
        --input-bg-color: #1F2937;
        --button-bg-color: #FFFFFF;
        --button-text-color: #000000;
    }
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Intro Section */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 60px 0 40px;
}

.header h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.header p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    max-width: 450px;
    margin: 0 auto;
}

main {
    flex-grow: 1;
}

/* Form */
#createFeedForm {
    max-width: 480px;
    margin: 0 auto 40px;
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

button {
    background: var(--button-bg-color);
    color: var(--button-text-color);
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

button:hover {
    opacity: 0.85;
}

/* Result Section */
#result {
    max-width: 480px;
    margin: 20px auto;
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    word-wrap: break-word;
}
#result.success-container {
    background: transparent;
    border: none;
    padding: 0;
}
#result.success-container strong {
    text-align: center;
    margin-bottom: 1.5rem;
}

#result p {
    margin: 0 0 10px 0;
}
#result p:last-child {
    margin-bottom: 0;
}

#result strong {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

code {
    background: var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.95em;
}

a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

a:hover {
    opacity: 0.8;
}

/* Info Card for Feed Management */
.info-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1.5rem;
    background-color: var(--input-bg-color);
}
.info-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.info-card-header p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.info-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    gap: 1rem;
}
.info-card-body code {
    background: none;
    padding: 0;
    word-break: break-all;
}
.copy-button {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease-in-out;
}
.copy-button:hover {
    opacity: 0.85;
}

/* General Feed Management Styles */
.feed-info, .entry-list {
    margin-top: 30px;
}
.feed-info p, .entry-list p {
    margin-bottom: 1rem;
}

.entry-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s ease-in-out;
}
.entry-item:first-child {
    border-top: 1px solid var(--border-color);
}
.entry-item:hover {
    background-color: var(--input-bg-color);
}

.feed-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background-color: var(--input-bg-color);
    border: 1px solid transparent; /* Make border transparent */
    border-radius: 6px; /* Slightly less rounded */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1rem;
}

.feed-details {
    flex-grow: 1;
}

.entry-item h4 {
    margin: 0 0 0.1rem 0;
    font-family: var(--font-sans); /* Use sans-serif for cleaner look */
    font-size: 1.1rem; /* Adjust size */
    font-weight: 600; /* Adjust weight */
}

.entry-item h4 a {
    text-decoration: none;
    color: var(--text-color);
}
.entry-item h4 a:hover {
    text-decoration: underline;
}

.entry-item h3 {
    margin-bottom: 0.5rem;
}
.entry-item h3 a {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
}
.entry-item h3 a:hover {
    text-decoration: underline;
}

.entry-meta {
    font-size: 0.85rem; /* Adjust size */
    color: var(--secondary-color);
    margin-bottom: 0; /* Adjusted for new layout */
}
.entry-meta span {
    margin-right: 1rem;
}
.entry-item div {
    font-size: 1rem;
    line-height: 1.7;
}

/* Individual Entry Page */
.entry-full h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.back-link {
    margin-bottom: 2rem;
    font-weight: bold;
}
.back-link a {
    text-decoration: none;
}
.back-link a:hover {
    text-decoration: underline;
}

.entry-content {
    margin-top: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
.entry-content a {
    text-decoration: underline;
}

/* New style for the feed link wrapper */
.feed-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
    padding: 1rem; /* Add padding to the link itself */
    margin: -1rem; /* Counteract the padding on the parent */
    border-radius: 6px;
}

/* Styles for the entry list on the feed page */
.entry-list-item {
    border-bottom: 1px solid var(--border-color);
}
.entry-list-item:first-child {
    border-top: 1px solid var(--border-color);
}
.entry-list-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease-in-out;
    border-radius: 6px;
    margin: 0 -0.5rem;
}
.entry-list-item a:hover {
    background-color: var(--input-bg-color);
}

.entry-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.entry-icon span {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.entry-text-content {
    flex-grow: 1;
}

.entry-title-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 0.1rem;
}

.entry-meta-line {
    font-size: 0.85rem;
    color: var(--secondary-color);
}
.entry-meta-line .entry-author {
    display: inline;
    text-transform: uppercase;
    font-weight: 700;
}
.entry-meta-line .entry-time {
    display: inline;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    font-size: 0.9em;
    color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
}

/* Bookmark Notification Styles */
.bookmark-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}
.bookmark-notice p {
    margin: 0;
    font-size: 0.9rem;
}
.bookmark-notice p a {
    font-weight: 600;
}

.notice-icon {
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #createFeedForm {
        flex-direction: column;
    }
}