/* ==========================================
   MODERN CSS FOR GAINSHARE
   Social Media Inspired Design
   Mobile-First & Responsive
   ========================================== */

/* CSS Variables for Easy Theming */
:root {
    --primary-bg: #000000;
    --secondary-bg: #1a1a1a;
    --tertiary-bg: #262626;
    --accent-color: #0095f6;
    --accent-hover: #1877f2;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --border-color: #363636;
    --error-color: #ed4956;
    --success-color: #00d95f;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --max-content-width: 935px;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--primary-bg);
    background-image:
        radial-gradient(at 20% 10%, rgba(0, 149, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 80% 90%, rgba(0, 149, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(38, 38, 38, 0.3) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px; /* Space for fixed footer */
}

/* ==========================================
   HEADER STYLES
   ========================================== */
header {
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
    background-color: rgba(26, 26, 26, 0.8);
}

.header-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-logo {
    display: flex;
    align-items: center;
    transition: transform var(--transition-speed);
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo img {
    height: 50px;
    width: auto;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    background-color: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 220px;
    transition: all var(--transition-speed);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    background-color: var(--secondary-bg);
    width: 260px;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* ==========================================
   FOOTER STYLES
   ========================================== */
footer {
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    backdrop-filter: blur(10px);
    background-color: rgba(26, 26, 26, 0.95);
}

.footer-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
}

/* ==========================================
   BUTTON STYLES
   ========================================== */
button {
    background: linear-gradient(145deg, var(--tertiary-bg), #2d2d2d);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(145deg, #2d2d2d, var(--tertiary-bg));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

button img,
button svg {
    height: 24px;
    width: 24px;
    filter: brightness(0) invert(1);
    transition: transform var(--transition-speed);
}

button:hover img,
button:hover svg {
    transform: scale(1.1);
}

button svg {
    stroke: currentColor;
    filter: none;
}

.btn-primary {
    background: linear-gradient(145deg, var(--accent-color), #0081d6);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--accent-hover), var(--accent-color));
    box-shadow: 0 6px 16px rgba(0, 149, 246, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--tertiary-bg);
    border-color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Icon-only buttons for footer */
.icon-button {
    padding: 0.625rem;
    background: transparent;
    border: none;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
    box-shadow: none;
    position: relative;
}

.icon-button::before {
    display: none;
}

.icon-button:hover {
    background: linear-gradient(145deg, var(--tertiary-bg), #2d2d2d);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.icon-button:active {
    background: var(--border-color);
    transform: scale(0.95);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==========================================
   FORM STYLES
   ========================================== */
.form-container {
    max-width: 400px;
    margin: 3rem auto;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    min-height: 44px; /* Touch-friendly */
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--text-secondary);
    background-color: var(--secondary-bg);
}

input::placeholder {
    color: var(--text-secondary);
}

select {
    cursor: pointer;
}

select option {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

form button[type="submit"] {
    margin-top: 1rem;
    width: 100%;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
}

form button[type="submit"]:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color var(--transition-speed);
}

.form-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==========================================
   LINKS
   ========================================== */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-hover);
}

/* Links wrapping buttons should not affect button styling */
a:has(button) {
    display: inline-block;
}

a button {
    color: inherit;
}

/* ==========================================
   CARDS & CONTENT
   ========================================== */
.card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.welcome-section {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(180deg, var(--secondary-bg) 0%, transparent 100%);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a8a8a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   POST CARD STYLES
   ========================================== */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.post-card {
    background: linear-gradient(145deg, var(--secondary-bg), #1f1f1f);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 149, 246, 0.3);
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.post-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.post-content {
    padding: 1.25rem;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.post-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.post-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
}

.post-action:hover {
    color: var(--text-primary);
    background: var(--tertiary-bg);
}

.post-action.liked {
    color: var(--error-color);
}

.post-action img,
.post-action svg {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(0.6);
    transition: filter var(--transition-speed);
}

.post-action:hover img,
.post-action:hover svg {
    filter: brightness(0) invert(1);
}

.post-action.liked img,
.post-action.liked svg {
    filter: brightness(0) invert(0.4) sepia(1) saturate(5) hue-rotate(320deg);
}

.post-stats {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.post-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 149, 246, 0.3);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Mobile Small (up to 375px) */
@media (max-width: 375px) {
    .header-logo img {
        height: 40px;
    }

    .search-input {
        width: 120px;
        font-size: 0.75rem;
    }

    .search-input:focus {
        width: 150px;
    }

    .footer-container {
        gap: 0.25rem;
    }

    button img {
        height: 20px;
        width: 20px;
    }

    .form-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
    }

    .header-container {
        height: 50px;
    }

    .search-input {
        display: none; /* Hide search on mobile, can be toggled with JS */
    }

    .header-actions {
        gap: 0.5rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .form-container {
        max-width: 100%;
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .welcome-section {
        padding: 2rem 1rem;
    }

    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .welcome-section p {
        font-size: 1rem;
    }

    body {
        padding-bottom: 65px;
    }

    /* Post cards on mobile */
    .posts-container {
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .post-card {
        border-radius: 12px;
    }

    .post-header {
        padding: 0.875rem 1rem;
    }

    .post-content {
        padding: 1rem;
    }

    .post-title {
        font-size: 1rem;
    }

    .post-text {
        font-size: 0.875rem;
    }

    .post-footer {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    .post-action span {
        display: none; /* Hide text on mobile, show only icons */
    }

    .post-action {
        padding: 0.5rem;
    }

    .post-stats {
        font-size: 0.75rem;
    }
}

/* Tablet (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-container,
    .footer-container {
        padding: 0 2rem;
    }

    main {
        padding: 2rem 2rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .search-input {
        width: 260px;
    }

    .search-input:focus {
        width: 300px;
    }

    body {
        padding-bottom: 0;
    }

    footer {
        position: relative;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   EMPTY STATES & MESSAGES
   ========================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Error and Success Messages */
.errormessage,
.successmessage,
.error-message,
.success-message {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem auto;
    max-width: 400px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.errormessage,
.error-message {
    background: linear-gradient(145deg, rgba(237, 73, 86, 0.15), rgba(237, 73, 86, 0.1));
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.successmessage,
.success-message {
    background: linear-gradient(145deg, rgba(0, 217, 95, 0.15), rgba(0, 217, 95, 0.1));
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--tertiary-bg);
    border-radius: 6px;
    border: 3px solid var(--primary-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ==========================================
   SELECTION STYLING
   ========================================== */
::selection {
    background: var(--accent-color);
    color: white;
}

::-moz-selection {
    background: var(--accent-color);
    color: white;
}

/* ==========================================
   FOCUS VISIBLE FOR ACCESSIBILITY
   ========================================== */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 4px;
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ==========================================
   TAGS & BADGES
   ========================================== */
.tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--tertiary-bg);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.tag:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ==========================================
   IMAGE OPTIMIZATION
   ========================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[src=""],
img:not([src]) {
    opacity: 0;
}

/* ==========================================
   ACCOUNT PAGE STYLES
   ========================================== */
.profile-pic {
    text-align: center;
    margin: 2rem auto;
}

.profile-pic img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 149, 246, 0.3);
    margin: 0 auto;
}

.user-info {
    background: linear-gradient(145deg, var(--secondary-bg), #1f1f1f);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: var(--card-shadow);
}

.user-info h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.user-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0.5rem 0;
    text-transform: capitalize;
}

main > div:has(a[href*="edit"]) {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem auto;
}

main > div a[href*="edit"],
main > div a[href*="logout"] {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(145deg, var(--tertiary-bg), #2d2d2d);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed);
}

main > div a[href*="logout"] {
    background: linear-gradient(145deg, rgba(237, 73, 86, 0.2), rgba(237, 73, 86, 0.1));
    border-color: var(--error-color);
    color: var(--error-color);
}

main > div a[href*="edit"]:hover,
main > div a[href*="logout"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: var(--max-content-width);
}

.posts .post {
    background: linear-gradient(145deg, var(--secondary-bg), #1f1f1f);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

.posts .post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.posts .post h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.posts .post img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.posts .post p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Create Post Form */
main > h1 {
    text-align: center;
    font-size: 2rem;
    margin: 2rem 0;
    color: var(--text-primary);
}

main > form {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(145deg, var(--secondary-bg), #1f1f1f);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

main > form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

main > form input[type="text"],
main > form input[type="file"],
main > form textarea {
    width: 100%;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed);
}

main > form textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

main > form input:focus,
main > form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.1);
}

main > form input[type="submit"] {
    background: linear-gradient(145deg, var(--accent-color), #0081d6);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    width: 100%;
}

main > form input[type="submit"]:hover {
    background: linear-gradient(145deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 149, 246, 0.4);
}

/* Posts Section Heading */
.posts-section {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.posts-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

/* Better body layout for logged-in users */
body.logged-in {
    padding-bottom: 75px;
}

/* Improve Create Form Specific Styles */
.create-form-container {
    max-width: 700px;
    margin: 2rem auto;
    background: linear-gradient(145deg, var(--secondary-bg), #1f1f1f);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.create-form-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.create-form-container .form-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .posts-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .create-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Override form styles for create-form-container */
.create-form-container form {
    max-width: 100%;
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.create-form-container .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.create-form-container label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.create-form-container input[type="text"],
.create-form-container input[type="file"],
.create-form-container textarea {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    font-family: inherit;
    width: 100%;
}

.create-form-container textarea {
    resize: vertical;
    min-height: 120px;
}

.create-form-container input:focus,
.create-form-container textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.1);
}

.create-form-container input[type="file"] {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.create-form-container input[type="file"]::file-selector-button {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 1rem;
    transition: all var(--transition-speed);
}

.create-form-container input[type="file"]::file-selector-button:hover {
    background: var(--border-color);
}

/* Fix body padding for logged in vs logged out */
body:not(.logged-in) {
    padding-bottom: 0;
}

body.logged-in {
    padding-bottom: 75px !important;
}

@media (max-width: 768px) {
    body.logged-in {
        padding-bottom: 70px !important;
    }
}

/* Logout button in header */
.btn-logout {
    background: linear-gradient(145deg, rgba(237, 73, 86, 0.2), rgba(237, 73, 86, 0.1)) !important;
    border: 2px solid var(--error-color) !important;
    color: var(--error-color) !important;
    box-shadow: none !important;
}

.btn-logout:hover {
    background: linear-gradient(145deg, rgba(237, 73, 86, 0.3), rgba(237, 73, 86, 0.2)) !important;
    border-color: var(--error-color) !important;
    box-shadow: 0 4px 12px rgba(237, 73, 86, 0.3) !important;
}

/* Profile avatar fallback */
.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: white;
    margin: 0 auto;
    box-shadow: 0 4px 16px rgba(0, 149, 246, 0.3);
}

/* Ensure footer is always visible at bottom of screen */
@media (min-width: 1025px) {
    footer {
        position: fixed !important;
        bottom: 0 !important;
    }
}

/* Force footer to stick to viewport bottom on all pages when logged in */
body.logged-in footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Adjust main content to not be hidden by footer */
body.logged-in main {
    padding-bottom: 2rem;
}

/* Empty state button */
.empty-state button,
.empty-state a button {
    margin-top: 1.5rem;
}
