/* Moon Ink - Minimalist Stylesheet */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-width: 800px;
}

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

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background: #fff;
    font-size: 16px;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.wide-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--primary-color);
    color: #fff;
    padding: 2rem 0;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Navigation */
nav {
    margin-top: 1.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 1;
}

/* Posts */
.post {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
}

.post-meta a {
    color: var(--secondary-color);
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-content {
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

.post-content h1,
.post-content h2,
.post-content h3 {
    margin: 1.5rem 0 1rem;
}

.post-content code {
    background: var(--light-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

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

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

.read-more:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

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

.pagination a:hover {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.category-tag {
    background: var(--light-gray);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.category-tag:hover {
    background: var(--secondary-color);
    color: #fff;
}

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

/* Messages */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    nav ul {
        gap: 1rem;
    }
}

/* Password visibility toggle */
.password-field-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Password strength meter */
.password-strength-container {
    margin-top: 15px;
    display: none;
}

.password-strength-container.active {
    display: block;
}

.strength-bar-container {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.strength-bar.very-weak {
    width: 16.67%;
    background: #dc3545;
}

.strength-bar.weak {
    width: 33.33%;
    background: #fd7e14;
}

.strength-bar.fair {
    width: 50%;
    background: #ffc107;
}

.strength-bar.good {
    width: 75%;
    background: #28a745;
}

.strength-bar.strong {
    width: 100%;
    background: #218838;
}

.strength-text {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.strength-text.very-weak { color: #dc3545; }
.strength-text.weak { color: #fd7e14; }
.strength-text.fair { color: #ffc107; }
.strength-text.good { color: #28a745; }
.strength-text.strong { color: #218838; }

.password-requirements {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 15px;
    font-size: 13px;
}

.requirement-item {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirement-icon {
    font-size: 14px;
    min-width: 16px;
    text-align: center;
}

.requirement-icon.met {
    color: #28a745;
}

.requirement-icon.unmet {
    color: #dc3545;
}

.requirement-text.met {
    color: #28a745;
}

.requirement-text.unmet {
    color: #666;
}