/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

/* Container and layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #333;
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: #666;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.home-link {
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

.profile-image {
    flex-shrink: 0;
}

.profile-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
}

/* Main content areas */
.intro {
    margin-bottom: 3rem;
}

.section {
    margin-bottom: 2.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Lists */
.article-list {
    list-style: disc;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-list li {
    margin-bottom: 0.5rem;
}

.article-list a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.article-list a:hover {
    border-bottom-color: #333;
}

/* Blog layout */
.articles-grid {
    display: grid;
    gap: 2rem;
}

.article-card {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.article-card:last-child {
    border-bottom: none;
}

.article-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.article-card h2 a {
    text-decoration: none;
}

.article-card h2 a:hover {
    text-decoration: underline;
}

.article-card time {
    color: #666;
    font-size: 0.9rem;
}

/* Article page */
.article-full {
    margin-bottom: 3rem;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.article-header h1 {
    margin-bottom: 0.5rem;
}

.article-header time {
    color: #666;
    font-size: 0.9rem;
}

.article-content {
    line-height: 1.7;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

.article-content blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

.article-content code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.article-content pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* Navigation links */
.back-link,
.article-navigation {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.back-link a,
.article-navigation a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link a:hover,
.article-navigation a:hover {
    color: #333;
    text-decoration: underline;
}

/* Signup page */
.signup-form {
    max-width: 400px;
    margin: 2rem 0;
}

.signup-note {
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Subscriber management */
.subscriber-stats {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.subscribers-table {
    border-top: 1px solid #eee;
}

.subscriber-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.subscriber-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
}

.subscriber-meta {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.subscriber-actions {
    display: flex;
    gap: 0.5rem;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 2rem;
}

.flash-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    background-color: #f0f8f0;
    border: 1px solid #d4e6d4;
    color: #2d5a2d;
}

.flash-message.error {
    background-color: #fdf2f2;
    border-color: #e6d4d4;
    color: #5a2d2d;
}

.flash-message.success {
    background-color: #f0f8f0;
    border-color: #d4e6d4;
    color: #2d5a2d;
}

/* Admin styles */
.admin-login {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
}

.admin-nav a:hover {
    color: #333;
}

.admin-content {
    margin-bottom: 3rem;
}

.admin-section {
    margin-bottom: 3rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Forms */
.login-form,
.admin-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label input {
    width: auto !important;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #555;
    color: white;
}

.btn-primary {
    background-color: #333;
}

.btn-primary:hover {
    background-color: #555;
}

.btn-secondary {
    background-color: #666;
}

.btn-secondary:hover {
    background-color: #777;
}

.btn-danger {
    background-color: #d32f2f;
}

.btn-danger:hover {
    background-color: #f44336;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Articles table */
.articles-table {
    border-top: 1px solid #eee;
}

.article-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.article-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.article-meta {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .article-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .article-actions {
        align-self: stretch;
        justify-content: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}
