/* ===========================================
   BASE STYLES & VARIABLES
   =========================================== */
body {
    background-color: #F9FAFC;
    padding-top: 0;
}

/* Brand & Utilities */
.brand {
    font-family: Lato, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #4A4A4F;
}

.red-o {
    color: #E84610;
}

.thin {
    font-weight: 300;
}

.light-bg {
    background-color: #fff;
}

.dark-bg {
    background-color: #445261;
}

.main-bg {
    background-color: #F9FAFC;
}

.faded {
    color: rgb(172, 175, 175);
}

.approval {
    color: rgb(222, 146, 168);
}

/* ===========================================
   CARD & POST STYLES
   =========================================== */
.card {
    border: none;
    background-color: transparent;
}

.card-title {
    font-size: 1.2rem !important;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 0.8rem;
    line-height: 1.4;
}

.image-flash {
    display: none !important;
}

.scale {
    width: 100%;
    height: auto;
}

.author {
    color: white;
    margin: 4px;
    text-transform: uppercase;
}

/* Post Link Hover Effects - Consolidated */
.post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-link:hover {
    text-decoration: none;
    color: inherit;
}

.post-link:hover .card-title {
    color: #E84610 !important;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-link:hover .card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.3s ease;
    background-color: transparent;
}

/* Prevent hover on all other elements */
.post-link:hover .card-text,
.post-link:hover .text-muted,
.post-link:hover .author,
.post-link:hover .faded {
    color: inherit !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

/* ===========================================
   POST CONTENT
   =========================================== */
.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.2;
    margin-top: 0;
    margin-left: 0;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
    margin-top: 2rem;
}

.post-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

/* ===========================================
   LAYOUT & GRID
   =========================================== */
.col-md-5th {
    flex: 0 0 20%;
    max-width: 20%;
}

.container.px-4.mb-4 {
    margin-bottom: 0.5rem !important;
}

.col-12.mt-3.left {
    margin-top: 0.5rem !important;
}

/* ===========================================
   HERO SECTION
   =========================================== */
.hero-section {
    position: absolute !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hero-image-container {
    height: 520px !important;
    width: 100vw !important;
    overflow: hidden !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
}

.hero-image {
    width: 100vw !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    filter: brightness(0.7);
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* ===========================================
   NAVIGATION
   =========================================== */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    z-index: 1030 !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.navbar-nav {
    align-items: center;
}

/* ===========================================
   PAGE SPACING
   =========================================== */
main {
    margin-top: 70px !important;
}

.home-page main {
    margin-top: 526px !important;
}

.other-pages main {
    margin-top: 80px !important;
}

/* ===========================================
   AUTHENTICATION & USER
   =========================================== */
.user-greeting {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    color: #445261 !important;
    margin-bottom: 0 !important;
    line-height: 1.5 !important;
}

.btn-warning {
    background-color: #E84610 !important;
    border-color: #E84610 !important;
    color: white !important;
}

.btn-warning:hover {
    background-color: #cc3e0e !important;
    border-color: #cc3e0e !important;
    color: white !important;
}

/* ===========================================
   UTILITIES
   =========================================== */
.category-buttons .btn {
    min-width: 150px;
}

.category-buttons .btn.active {
    background-color: #4A4A4F;
    color: white;
    border-color: #4A4A4F;
}

.btn-like {
    color: #E84610;
    border: none;
    background: transparent;
}

.btn-delete {
    color: #fff;
    background: #E84610;
}

.link {
    color: #23BBBB;
    text-decoration: none;
}

.link:hover {
    color: #445261;
    text-decoration: underline;
}

/* ===========================================
   IMAGE STYLES
   =========================================== */
.card-img-top {
    aspect-ratio: 4 / 3;
    width: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0.375rem 0.375rem 0 0;
    transition: transform 0.3s ease;
}

.card-img-top:hover {
    transform: scale(1.02);
}

.post-image img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    max-height: 400px;
    width: 100%;
    object-fit: cover;
}

.post-image img:hover {
    transform: scale(1.02);
}

/* Default placeholder styling */
.image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem 0.375rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Responsive image adjustments */
@media (max-width: 768px) {
/*    .card-img-top {
        height: 180px;
    } */

    .post-image img {
        max-height: 300px;
    }

    .image-placeholder {
        height: 180px;
    }
}

/* ===========================================
   RESPONSIVE MOBILE (768px and below)
   =========================================== */
@media (max-width: 768px) {

    /* Grid */
    .col-md-5th {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Hero */
    .hero-image-container {
        height: 350px !important;
    }

    .home-page main {
        margin-top: 356px !important;
    }

    /* Page spacing */
    .other-pages main {
        margin-top: 45px !important;
    }

    /* Forms */
    .card {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
        box-shadow: none !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .form-control {
        font-size: 16px;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.5rem;
    }

    .form-label {
        margin-bottom: 0.25rem !important;
        font-size: 0.9rem;
    }

    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .post-title {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* User */
    .user-greeting {
        font-size: 1rem !important;
        margin-right: 0.5rem !important;
    }

    .toast {
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        min-width: 300px;
    }
    .btn-sm {
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* ===========================================
   RESPONSIVE TABLET (769px to 991px)
   =========================================== */
@media (min-width: 769px) and (max-width: 991.98px) {
    .col-md-5th {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .hero-image-container {
        height: 500px !important;
    }

    .other-pages main {
        margin-top: 55px !important;
    }

    .card {
        margin-top: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    .post-title {
        font-size: 2rem !important;
    }

    /* Hero positioning for tablet */
    .home-page .hero-section {
        position: relative !important;
        top: auto !important;
        margin-top: 0 !important;
    }

    .home-page main {
        margin-top: 0 !important;
    }
}

/* ===========================================
   MOBILE NAVIGATION (991px and below)
   =========================================== */
@media (max-width: 991.98px) {

    /* Mobile navbar styling */
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98) !important;
        margin-top: 0.5rem !important;
        border-radius: 0.375rem !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        padding: 1rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }

    /* Menu alignment */
    .navbar-nav {
        text-align: left !important;
        align-items: flex-start !important;
    }

    .navbar-nav .nav-link {
        text-align: left !important;
        padding: 0.5rem 0 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0.25rem !important;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-item {
        width: 100% !important;
    }

    /* User controls */
    .user-greeting {
        text-align: left !important;
        padding: 0.5rem 0 !important;
    }

    .btn-sm {
        margin-top: 0.5rem !important;
        width: auto !important;
        text-align: center !important;
    }

    /* Hero positioning for mobile */
    .home-page .hero-section {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: 1 !important;
        margin-top: 0 !important;
    }

    .home-page main {
        margin-top: 0 !important;
    }

    .navbar {
        z-index: 1050 !important;
    }

    .navbar-collapse.show {
        position: relative !important;
        z-index: 1051 !important;
    }
}

/* ===========================================
   SMALL MOBILE (576px and below)
   =========================================== */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .other-pages main {
        margin-top: 40px !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    .post-title {
        font-size: 1.5rem !important;
        line-height: 1.1;
    }

    /* Mobile navbar */
    .navbar-collapse {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        padding: 1rem 1.5rem !important;
    }

    .navbar-nav .nav-link {
        font-size: 1.1rem !important;
        padding: 0.75rem 0 !important;
    }

    /* User section */
    .d-flex.align-items-center {
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    .user-greeting {
        margin-bottom: 0.25rem !important;
        margin-right: 0 !important;
    }
}

/* ===========================================
   LARGE SCREENS (1025px and above)
   =========================================== */
@media (min-width: 1025px) and (max-width: 1366px) {
    .other-pages main {
        margin-top: 65px !important;
    }
}

@media (min-width: 1367px) {
    .other-pages main {
        margin-top: 80px !important;
    }

    .form-control {
        padding: 0.75rem 1rem;
    }

    .form-control-lg {
        padding: 1rem 1.25rem;
    }
}

.choose-category-title {
    display: block !important;
    margin-top: 1.5rem !important;   /* Default for mobile/tablet */
    margin-bottom: 1rem !important;
    font-size: 2rem !important;
    color: #2c3e50 !important;
    text-align: center !important;
}

@media (min-width: 1024px) {
    .choose-category-title {
        margin-top: 2rem !important; /* Larger space for desktop */
    }
}

@media (min-width: 1024px) {
    .hero-section {
        margin-bottom: 3rem !important; /* Adjust value as needed */
    }
}

.custom-toast-position {
    right: 15rem !important; /* Move toast 10rem from the right edge */
    /* Or use left: auto; right: 10rem; for more control */
}

.custom-toast-style {
    box-shadow: 0 4px 40px rgba(216, 38, 7, 0.637);
    border-radius: 0.75rem;
    font-size: 1.6rem;
    text-align: center;
    /* Add more custom styles as needed */
}

@media (max-width: 765px) {
    .custom-toast-position {
        right: 1rem !important; /* Move toast closer to the right edge on mobile */
        left: 1rem !important;  /* Optionally, add some left margin */
    }
    .custom-toast-style {
        font-size: 1.1rem;
        box-shadow: 0 2px 6px rgba(216, 38, 7, 0.3);
        border-radius: 0.5rem;
        padding: 0.5rem 1rem;
    }
}