@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --text-main: #1f2937; /* Gray 800 */
    --text-secondary: #4b5563; /* Gray 600 */
    --bg-body: #f3f4f6; /* Gray 100 */
    --bg-card: #ffffff;
    --border-color: #e5e7eb; /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Navigation */
nav {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary);
}

/* Layout */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-main);
    margin-top: 0;
}

h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; font-weight: 600; }

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .col-span-2 {
        grid-column: span 2;
    }
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box; /* Important for padding */
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
button, .button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}

button[type="submit"], .button-primary {
    background-color: var(--primary);
    color: white;
}

button[type="submit"]:hover, .button-primary:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: translateY(1px);
}

/* Quill Editor Customization */
.ql-toolbar.ql-snow {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    border-color: var(--border-color) !important;
    background: #f9fafb;
}

.ql-container.ql-snow {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-color: var(--border-color) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
}

#editor-container {
    min-height: 400px;
}

/* Posts List */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.post-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

/* Post Content Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
    margin: 1.5rem auto;
}
