/* General Button Styles */
button {
    background-color: #f3f7fe;
    color: #3b82f6;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    width: 100px;
    height: 45px;
    transition: 0.3s;
}
/* MODIFIKASI INI untuk menghilangkan border putih saat klik/fokus */
.navbar-toggler:focus,
.navbar-toggler:active,
.navbar-toggler:hover { /* Opsional: jika ingin menghilangkan border juga saat hover */
    outline: none !important; /* Menghilangkan outline default browser */
    box-shadow: none !important; /* Menghilangkan box-shadow yang mungkin ditambahkan Bootstrap */
    border-color: transparent !important; /* Memastikan tidak ada border yang muncul */
}

/* Pastikan juga aturan untuk ikon hamburger tetap ada seperti sebelumnya */
.navbar-toggler .fas.fa-bars {
    color: #fff !important;
    font-size: 1.1rem; /* Sesuaikan ukuran ikon */
}

/* Dan aturan untuk ukuran tombol toggler itu sendiri */
.navbar-toggler {
    padding: 0.25rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    /* Anda mungkin juga ingin menambahkan ini jika ada border default yang ingin dihilangkan */
    border: none; /* Pastikan tidak ada border standar */
}


button:hover {
    background-color: #3b82f6;
    box-shadow: 0 0 0 5px #3b83f65f;
    color: #fff;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff6b6b, #d63031);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c0392b #f1f1f1;
}

/* Root Variables */
:root {
    --primary-blue: #004d99; /* Deeper blue for police theme */
    --secondary-dark: #1a1a1a;
    --light-gray: #f8f9fa;
    --text-color: #333;
    --heading-color: #003366; /* Darker blue for headings */
    --accent-green: #28a745;
    --navbar-bg: #0c0950; /* Changed to match your navbar color */
    --navbar-link-color: #fff;
    --navbar-dropdown-bg: #000000; /* Same as navbar background */
}

/* Base Body Styles */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}
main {
    flex-grow: 1;
}
.fixed-top {
    z-index: 1030;
}

/* Navbar Styles */
.navbar {
    background-color: var(--navbar-bg); /* Menggunakan variabel untuk konsistensi */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1rem;
}

.humasicon:hover {
    filter: brightness(0);
    -webkit-filter: brightness(0);
}

.humasicon {
    height: 30px;
    transition: filter 0.3s ease;
}

.navbar-brand .humasicon {
    height: 30px; /* Adjust as needed */
    margin-right: 10px;
}

/* Navbar links */
.navbar-nav .nav-link {
    color: var(--navbar-link-color) !important; /* Important to override Bootstrap defaults */
    font-weight: bold;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #ccc !important; /* Lighter white on hover */
}

/* Dropdown menu */
/* Perbaiki background-color di sini! */
.dropdown-menu {
    background-color: var(--navbar-dropdown-bg);
    /*Gunakanvariabel,bukan#0000*/border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
    border-radius:5px ;
    -webkit-border-radius:5px ;
    -moz-border-radius:5px ;
    -ms-border-radius:5px ;
    -o-border-radius:5px ;
}

.dropdown-item {
    color: var(--navbar-link-color); /* White text for dropdown items */
    padding: 0.75rem 1rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Subtle background on hover */
    color: var(--navbar-link-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark Button Styles */
.btn-dark {
    background-color: #333;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-dark:hover {
    background-color: #555;
}

/* Hero Section */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/polda.jpeg');
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    color: #fff;
    text-align: center;
    position: relative;
    margin-top: 56px; /* Offset for fixed navbar */
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.hero .lead {
    max-width: 800px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
}

/* Main Content Section */
.main-content {
    padding: 60px 0;
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
}

.main-content h2 {
    font-size: 2.2em;
    color: var(--heading-color);
    margin-bottom: 30px;
    font-weight: 600;
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 10px;
    display: inline-block;
    text-align: left;
    width: 100%;
}

.main-content p {
    font-size: 1.05em;
    text-align: justify;
    margin-bottom: 1.5em;
    color: var(--text-color);
}

/* Subtle background pattern for the body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%239C92AC" fill-opacity="0.05" fill-rule="evenodd"%3E%3Cpath d="M5 0h1L0 6V5zm1 6v-1L1 0h1z"/%3E%3C/g%3E%3C/svg%3E');
    z-index: -1;
    opacity: 0.3;
}

/* Footer Styles */
footer {
    background-color: var(--secondary-dark);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
}

footer p {
    margin-bottom: 0;
    font-size: 0.9em;
}



/* --- Custom Styles for Navbar Logo & Text --- */
.navbar-brand.logo-brand {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between home icon and POLDA RIAU logo/text */
}

.navbar-brand.logo-brand .pid-logo {
    height: 40px; /* Adjust height as needed */
    width: auto;
}

.navbar-brand.logo-brand .pid-text {
    color: white; /* Or your preferred text color */
    font-size: 1.4rem; /* Adjust font size as needed */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Global Search Form Styling (from previous home.blade.php) */
.row.my-4.justify-content-center {
    margin-bottom: 2rem !important; /* Ensure consistent spacing */
}
.form-control-lg {
    padding: 0.75rem 1.25rem; /* Larger padding for search input */
    font-size: 1.25rem;
}
.btn-lg {
    padding: 0.75rem 1.5rem; /* Larger padding for search button */
    font-size: 1.25rem;
}

/* News Section (Carousel & Pinned Posts) (from previous home.blade.php) */
.news-section .container {
    padding-left: 0;
    padding-right: 0;
}

/* Carousel Specific Styles (from previous home.blade.php) */
#latestNewsCarousel .carousel-item img {
    height: 400px; /* Default height for desktop */
    object-fit: cover;
}
#latestNewsCarousel .card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%); /* Stronger gradient */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    transition: background 0.3s ease; /* Smooth transition on hover if needed */
}
#latestNewsCarousel .card-img-overlay h5 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem; /* Default font size for carousel title */
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Text shadow for readability */
}
#latestNewsCarousel .card-img-overlay small {
    font-size: 0.9rem;
}
.badgecara { /* Custom badge for carousel and pinned posts */
    background-color: #75010f !important; /* Your custom red color */
    color: white;
    padding: 0.4em 0.7em;
    font-size: 0.75em;
    border-radius: 0.25rem;
    white-space: normal; /* Allow text to wrap within badge */
}

/* Pinned Posts Specific Styles (from previous home.blade.php) */
.col-md-4 > h5 { /* Target the H5 directly under col-md-4 for 'Informasi Pilihan' */
    color: #75010f;
    font-weight: bold;
    margin-bottom: 1rem !important; /* More space below title */
}
.col-md-4 .d-flex.mb-3.align-items-center {
    padding-bottom: 10px; /* Add padding at the bottom of each item */
    border-bottom: 1px solid #eee; /* Light separator line */
}
.col-md-4 .d-flex.mb-3.align-items-center:last-child {
    border-bottom: none; /* No border for the last item */
}
.col-md-4 .d-flex.mb-3.align-items-center img {
    width: 100px; /* Default image size */
    height: 75px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 5px; /* Slightly rounded corners */
}
.col-md-4 .d-flex.mb-3.align-items-center div {
    flex-grow: 1;
    padding-left: 10px; /* Space between image and text */
}
.col-md-4 .d-flex.mb-3.align-items-center h6 {
    line-height: 1.4;
    font-size: 0.95rem; /* Slightly larger font for better readability */
    margin-bottom: 5px;
}
.col-md-4 .d-flex.mb-3.align-items-center small {
    font-size: 0.75rem;
}
.col-md-4 div[style*="max-height: 500px;"] { /* Targeting the scrollable div for pinned posts */
    max-height: 500px; /* Keep the max-height */
    overflow-y: auto;
    padding-right: 5px; /* Add a little padding to avoid scrollbar overlapping content */
}

/* Video Profile Section (from previous home.blade.php) */
.video-profile-container h2 {
    background-color: #75010f; /* Use your custom red color */
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    padding: 15px 0;
    margin: 0;
    border-radius: 8px;
    line-height: 1;
    font-size: 2.2em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.video-profile-container video {
    width: 100%;
    border-radius: 8px;
    margin-top: 20px;
}

/* Kategori Konten Section (from previous home.blade.php) */
.category-content-section h2 {
    background-color: #75010f; /* Use your custom red color */
    color: #ffffff;
    font-weight: bold;
    padding: 15px 0;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    line-height: 1;
    font-size: 2.2em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 800px;
}
.category-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none !important; /* Remove Bootstrap default border */
    position: relative; /* Needed for overlay */
    overflow: hidden; /* Hide anything that goes outside */
    height: 100%; /* Ensure all cards in a row have equal height */
    background-color: #f8f9fa; /* Light background for cards without image */
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2) !important;
}
.category-card .category-image {
    width: 100%;
    height: 180px; /* Consistent height for category images */
    object-fit: cover;
    filter: brightness(0.8); /* Slightly dim the image for text contrast */
    transition: filter 0.3s ease-in-out;
}
.category-card:hover .category-image {
    filter: brightness(1); /* Brighten image on hover */
}
.category-card .category-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%); /* Stronger gradient */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end; /* Align text to the bottom */
    justify-content: flex-start;
    padding: 1rem;
    box-sizing: border-box; /* Include padding in width/height */
}
.category-card .card-title {
    font-weight: bold;
    margin: 0;
    text-transform: uppercase; /* Ensure text is uppercase as in example */
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-size: 1.1rem; /* Default font size */
    line-height: 1.3;
}
.category-card .card-body {
    min-height: 180px; /* Consistent min-height for cards without image */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #75010f; /* Use your custom red for no-image cards */
    color: white;
    padding: 1rem;
    box-sizing: border-box;
}
.category-card .card-body .card-title {
    font-size: 1.1rem;
}

/* Statistik, Channel Humas Polri, Link Terkait Sections - Shared Styles (from previous home.blade.php) */
.container.my-4 .col-md-4 > div.border { /* Target the .border div inside col-md-4 */
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px; /* Added border-radius */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Subtle shadow */
    height: 100%; /* Ensure consistent height within columns */
    display: flex;
    flex-direction: column;
}
.container.my-4 .col-md-4 .mb-2 { /* Target the badge container */
    background-color: #75010f; /* Your custom red color */
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 0.75rem; /* Adjust margin */
    align-self: flex-start; /* Align badge to start */
}
.container.my-4 .col-md-4 .mb-2 span { /* Target the text inside the badge */
    color: white;
    font-weight: bold;
    text-align: center;
    display: block;
    font-size: 0.9rem; /* Smaller font for these titles */
}
.container.my-4 .col-md-4 ul.list-unstyled { /* Target the list itself */
    list-style: none; /* Remove default list bullets */
    padding: 0;
    margin-top: 0.5rem !important; /* Adjust top margin for list */
    flex-grow: 1; /* Allow list to take available space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center list items vertically if space allows */
}
.container.my-4 .col-md-4 ul.list-unstyled li {
    margin-bottom: 0.5rem; /* Space between list items */
}
.container.my-4 .col-md-4 ul.list-unstyled li:last-child {
    margin-bottom: 0;
}
.container.my-4 .col-md-4 ul.list-unstyled li a {
    color: #0C0950;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}
.container.my-4 .col-md-4 ul.list-unstyled li a:hover {
    color: #75010f; /* Hover effect for links */
}
.container.my-4 img[src*="flagcounter.com"] {
    max-width: 100%; /* Ensure image doesn't overflow */
    height: auto;
}

/* Media Queries for Responsiveness */

/* Small devices (landscape phones, 576px and up) - Bootstrap 'sm' */
/* Combined max-width: 575.98px media queries */
@media (max-width: 575.98px) {
    .hero h1 {
        font-size: 2em; /* Smaller font for very small screens */
    }
    .hero .lead {
        font-size: 0.9em; /* Even smaller lead text */
        padding: 0 10px;
    }
    .main-content {
        padding: 20px 10px; /* Less padding for tight spaces */
        margin-top: -20px; /* Adjust overlap */
    }
    .main-content h2 {
        font-size: 1.6em; /* Smaller heading for mobile */
    }
    .main-content p {
        font-size: 0.9em; /* Smaller paragraph text */
    }
    footer p {
        font-size: 0.8em; /* Smaller footer text */
    }
    /* Carousel Adjustments */
    #latestNewsCarousel .carousel-item img {
        height: 180px !important; /* Smaller height for very small screens */
    }
    #latestNewsCarousel .card-img-overlay {
        padding: 1rem !important;
    }
    #latestNewsCarousel .card-img-overlay h5 {
        font-size: 1.0rem; /* Smaller font for very small screens */
    }
    #latestNewsCarousel .card-img-overlay small {
        font-size: 0.8rem;
    }
    /* Pinned Posts Adjustments */
    .col-md-4:last-of-type { /* Target 'Informasi Pilihan' column */
        margin-top: 20px;
    }
    .col-md-4 .d-flex.mb-3.align-items-center {
        flex-direction: row;
        align-items: center !important;
        text-align: left;
        padding-bottom: 8px;
    }
    .col-md-4 .d-flex.mb-3.align-items-center img {
        width: 60px !important; /* Even smaller image size */
        height: 45px !important;
        margin-right: 8px;
    }
    .col-md-4 .d-flex.mb-3.align-items-center h6 {
        font-size: 0.75rem !important; /* Smaller font */
        margin-bottom: 3px !important;
    }
    .col-md-4 .d-flex.mb-3.align-items-center small {
        font-size: 0.6rem !important; /* Even smaller font */
    }
    .col-md-4 div[style*="max-height: 500px;"] {
        max-height: 300px; /* Smaller max-height */
    }
    /* Section Titles (PROFIL, KATEGORI KONTEN) */
    h2 {
        font-size: 1.2em !important; /* Smaller font */
        padding: 8px 0 !important;
    }
    .video-profile-container video {
        margin-top: 15px !important;
    }
    /* Kategori Konten Adjustments */
    .category-content-section .row {
        padding: 0 10px;
    }
    .category-content-section .col {
        margin-bottom: 15px;
    }
    .category-card .category-image {
        height: 100px; /* Smaller height */
    }
    .category-card .category-overlay {
        padding: 0.75rem;
    }
    .category-card .card-title {
        font-size: 0.85rem; /* Smaller font */
    }
    .category-card .card-body {
        min-height: 100px !important; /* Smaller min-height */
    }
    /* Statistik, Channel, Link Terkait Sections - Mobile Specific */
    .container.my-4 .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0 15px;
    }
    .container.my-4 .col-md-4 {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
        margin-bottom: 20px;
        padding-left: 0;
        padding-right: 0;
    }
    .container.my-4 .col-md-4:nth-last-child(1),
    .container.my-4 .col-md-4:nth-last-child(2) {
        margin-bottom: 25px; /* Keep this if needed for layout, otherwise remove */
    }
    .container.my-4 .col-md-4:last-child:nth-child(odd) {
        margin-right: auto;
        margin-left: auto;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .container.my-4 .col-md-4 > div.border {
        padding: 15px !important;
    }
    .container.my-4 .col-md-4 .mb-2 {
        margin-bottom: 0.5rem !important;
        padding: 3px 8px !important;
    }
    .container.my-4 .col-md-4 .mb-2 span {
        font-size: 0.75rem;
    }
    .container.my-4 ul.list-unstyled li {
        margin-bottom: 0.3rem;
    }
    .container.my-4 ul.list-unstyled li a {
        font-size: 0.7rem;
    }
    .container.my-4 img[src*="flagcounter.com"] {
        max-width: 90px;
    }
    /* Navbar Specific Adjustments for Mobile */
    .navbar-brand.logo-brand .humasicon {
        height: 30px;
    }
    .navbar-brand.logo-brand .pid-logo {
        height: 30px;
    }
    .navbar-brand.logo-brand .pid-text {
        font-size: 1rem;
    }
    /* Styles for collapsed navbar on smaller screens */
    .navbar-collapse {
        background-color: var(--navbar-bg); /* Menggunakan variabel */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 1000;
        padding-bottom: 15px;
    }

    .navbar-nav {
        flex-direction: column; /* Stack menu items vertically */
        align-items: flex-start; /* Align items to the left */
    }

    .navbar-nav .nav-item {
        width: 100%; /* Full width for each menu item */
        text-align: left;
    }

    .navbar-nav .nav-link {
        padding: 10px 15px; /* Adjust padding for better touch targets */
        margin: 0; /* Remove horizontal margins */
    }

    .dropdown-menu {
        position: static !important; /* Make dropdowns flow with the content */
        float: none !important;
        width: 100%;
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .dropdown-item {
        padding-left: 30px; /* Indent dropdown items */
    }
}

/* Medium devices (tablets, 768px and up) - Bootstrap 'md' */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero h1 {
        font-size: 2.5em;
    }
    .hero .lead {
        font-size: 0.95em;
        padding: 0 15px;
    }
    .main-content {
        padding: 30px 15px;
        margin-top: -30px;
    }
    .main-content h2 {
        font-size: 1.8em;
        text-align: center; /* Center align headings on mobile */
        display: block;
        width: auto;
    }
    .main-content p {
        font-size: 0.95em;
    }
    footer {
        padding: 30px 15px;
        font-size: 0.85em;
    }
}

/* Large devices (desktops, 992px and up) - Bootstrap 'lg' */
@media (min-width: 992px) {
    .hero {
        padding: 100px 0; /* Revert to desktop padding */
        min-height: 50vh; /* Revert to desktop min-height */
    }
    .hero h1 {
        font-size: 3.5em; /* Revert to desktop font size */
    }
    .hero .lead {
        font-size: 1.05em; /* Revert to desktop font size */
        padding: 0;
    }
    .main-content {
        padding: 60px 0; /* Revert to desktop padding */
        margin-top: -50px; /* Revert to desktop margin */
    }
    .main-content h2 {
        font-size: 2.2em; /* Revert to desktop font size */
        text-align: left; /* Revert to desktop alignment */
        display: inline-block; /* Revert to desktop display */
        width: 100%; /* Revert to desktop width */
    }
}