/* Reset default styles for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Navigation Bar */
nav {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

/* Headings */
h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a202c;
}

/* Post Container */
.post {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Post Content */
.post-content {
    font-size: 16px;
    color: #4a5568;
}

.post-content p {
    margin: 0 0 10px 0; /* Space between paragraphs */
    line-height: 1.5; /* Improve readability */
}

.post-content.truncated {
    max-height: 100px; /* Uniform height for previews */
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-content.expanded {
    max-height: none; /* Show full content */
}

/* Read More Button */
.read-more {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.read-more:hover {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: scale(1.05);
}

/* Author Info */
.post p[style*="font-style: italic"] {
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
    margin-top: 10px;
}

/* Buttons (Edit/Delete/Cancel) */
button.edit-button, button.delete-button {
    background: #e2e8f0;
    color: #1a202c;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-right: 10px;
    margin-top: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

button.edit-button:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: scale(1.05);
}

button.delete-button {
    background: #fecaca;
    color: #991b1b;
}

button.delete-button:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.05);
}

button.cancel-button {
    background: #e2e8f0;
    color: #1a202c;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    margin-right: 10px;
    margin-top: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

button.cancel-button:hover {
    background: #cbd5e1;
    color: #1a202c;
    transform: scale(1.05);
}


/* Forms (Login, Signup, Create Post, Edit Post) */
form {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    margin: 20px auto;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 5px;
}

form input, form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

form textarea {
    resize: vertical;
    min-height: 100px;
}

form button[type="submit"] {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.2s ease;
}

form button[type="submit"]:hover {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: scale(1.05);
}

/* Error Messages */
#login-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .post {
        padding: 15px;
        margin-bottom: 20px;
    }

    nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    form {
        padding: 15px;
    }
}
