/* Admin Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    color: var(--secondary-color);
    font-size: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.recent-posts {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.recent-posts h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th {
    background: var(--bg-color);
    padding: 1rem;
    text-align: left;
    color: var(--secondary-color);
    font-weight: 600;
}

.posts-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.posts-table tr:hover {
    background: #f9f9f9;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

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

/* Inline styles replacements for dashboard */
.welcome-message {
    font-size: 1.2rem;
    color: #666;
}

.change-password-link {
    margin-left: 20px;
    color: #4CAF50;
    text-decoration: none;
}

.post-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Admin Comments Styles */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.comments-header h1 {
    color: var(--secondary-color);
}

.comments-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-item {
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.comment-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-item.pending {
    background: #fff3cd;
    border-color: #ffc107;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.comment-author {
    font-weight: 600;
    color: var(--secondary-color);
}

.comment-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.comment-post-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.comment-post-link:hover {
    text-decoration: underline;
}

.comment-content {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
    line-height: 1.6;
}

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

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.no-comments {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Inline styles replacements for comments */
.comment-email {
    color: #666;
    font-size: 0.9rem;
}

.inline-form {
    display: inline;
}

/* Admin Posts Styles */
.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.posts-header h1 {
    color: var(--secondary-color);
}

.posts-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.posts-table th {
    position: sticky;
    top: 0;
}

.posts-table td {
    vertical-align: middle;
}

.post-title {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.post-title:hover {
    color: var(--primary-color);
}

.status-badge {
    display: inline-block;
}

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

/* Admin Login Styles */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--secondary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
}

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

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

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

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.back-link {
    text-align: center;
    margin-top: 1rem;
}

.back-link a {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Admin Change Password Styles */
.change-password-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.change-password-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.change-password-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #666;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #555;
}

.password-requirements {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.password-requirements ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.password-requirements li {
    margin: 5px 0;
}

/* Inline styles replacements for password page */
.button-container {
    margin-top: 20px;
}

/* Responsive Styles for Admin */
@media (max-width: 768px) {
    .comments-container {
        padding: 1rem;
    }

    .comment-item {
        padding: 1rem;
    }

    .posts-table {
        font-size: 0.85rem;
    }

    .posts-table th,
    .posts-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Post Editor Styles */
@font-face {
    font-family: 'Kavivanar';
    src: url('/static/fonts/Kavivanar-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.editor-container {
    max-width: 1400px;
    margin: 0 auto;
}

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

.editor-header h1 {
    color: var(--secondary-color);
    font-size: 2rem;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.editor-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.preview-panel h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

#preview-content {
    line-height: 1.7;
}

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

.editor-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.editor-form .form-group input[type="text"],
.editor-form .form-group textarea,
.editor-form .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.editor-form .form-group textarea {
    min-height: 400px;
    resize: vertical;
    font-family: 'Noto Sans Tamil', monospace;
    line-height: 1.6;
}

.editor-form .form-group textarea#excerpt {
    min-height: 80px;
}

.editor-form .form-group input:focus,
.editor-form .form-group textarea:focus,
.editor-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor-form .form-group small {
    display: block;
    margin-top: 0.3rem;
    color: #666;
    font-size: 0.85rem;
}

.editor-form .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-form .checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.editor-form .checkbox-group label {
    margin: 0;
    cursor: pointer;
}

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

.formatting-help {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.formatting-help h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.formatting-help ul {
    list-style: none;
    padding: 0;
}

.formatting-help li {
    margin: 0.3rem 0;
    color: #555;
}

.formatting-help code {
    background: white;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

/* Preview poem styling */
#preview-content .poem-inline {
    font-family: 'Kavivanar', 'TAU Marutham', 'Noto Sans Tamil', serif;
    font-size: 1.1rem;
    color: #2c1810;
    display: block;
    line-height: 1.3;
    padding: 0.1rem 0;
    white-space: pre-wrap;
}

/* Preview content styling - preserve whitespace in paragraphs */
#preview-content p {
    white-space: pre-wrap;
}

#preview-content ul {
    list-style-type: disc;
    list-style-position: outside;
    margin-left: 2rem;
}

#preview-content ol {
    list-style-type: decimal;
    list-style-position: outside;
    margin-left: 2rem;
}

#preview-content li {
    display: list-item;
    margin-bottom: 0.5rem;
}

.preview-placeholder {
    color: #999;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .editor-form, .preview-panel {
        padding: 1.5rem;
    }
}
