/* Custom CSS for DEHIKAS SINERGI SEMESTA Website */

:root {
    --primary-color: #fff8e5;
    --secondary-color: #fce6aa;
    --primary-text-color: #010557;
    --secondary-text-color: #68a2f3;
    --primary-color: #fff8e5;
    --navy-secondary: #1e40af;
    --navy-light: #3b82f6;
    --navy-dark: #1e293b;
    --gold-accent: #fbbf24;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --dark-gray: #64748b;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Ensure Font Awesome icons load smoothly */
@font-face {
    font-family: 'Font Awesome 5 Free';
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-brands-400.woff2') format('woff2');
    font-display: swap;
    /* Apply swap to ensure text remains visible while font loads */
}

@font-face {
    font-family: 'Font Awesome 5 Free';
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2') format('woff2');
    font-display: swap;
}

.bg-header {
    background-color: var(--primary-color) !important;
}

.navbar.bg-header {
    background-color: rgba(10, 25, 70, 0.8);
    /* navy with opacity */
    backdrop-filter: blur(8px);
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
    border-bottom: 1px solid rgba(1, 5, 87, 0.1);
}

.text-navy {
    color: var(--primary-text-color) !important;
}

.p-newline {
    white-space: pre-line;
}

.text-justify {
    text-align: justify !important;
}

/* Top Bar */
.top-bar {
    background-color: var(--navy-dark);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar .contact-info span {
    margin-right: 20px;
}

.top-bar .contact-info i {
    margin-right: 5px;
    color: var(--gold-accent);
}

/* Navigation */
.navbar-brand img {
    height: 60px;
}

.navbar-nav .nav-link {
    color: var(--primary-text-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link.active {
    color: var(--secondary-text-color) !important;
    font-weight: 700;
    /* Dibuat lebih tebal dari default 500 */
}

.dropdown-item.active,
.dropdown-item:active {
    color: var(--primary-text-color);
    background-color: #f1f1f1;
}

/* Modern Search Bar */
.search-bar-modern {
    position: relative;
    width: 300px;
    border-radius: var(--bs-border-radius-pill) !important;
    border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
}

@media (max-width: 768px) {
    .navbar .container {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .search-bar-modern {
        width: 100%;
        margin: 1rem;
    }
}

/* Input styling */
.search-bar-modern input {
    border-radius: 30px 0 0 30px !important;
    padding: 0.6rem 1rem;
    border: none;
}

.search-bar-modern button {
    border-radius: 0 30px 30px 0 !important;
    border: none;
}

#liveSearchResults {
    position: absolute;
    top: 105%;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 400px;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

/* When visible */
#liveSearchResults.show {
    display: block !important;
}

/* Each item */
#liveSearchResults .dropdown-item {
    padding: 10px 15px;
    font-size: 0.95rem;
    color: #333;
}

#liveSearchResults .dropdown-item:hover {
    background-color: #f5f5f5;
}

/* Section titles */
#liveSearchResults .section-title {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 15px;
    color: #666;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
    margin-bottom: 0 !important;
}

#liveSearchResults .section-title::after {
    display: none;
}

/* "Lihat semua" link */
#liveSearchResults .view-all {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #eee;
}

#liveSearchResults .view-all a {
    font-size: 0.9rem;
    color: #007bff;
    text-decoration: none;
}

#liveSearchResults .view-all a:hover {
    text-decoration: underline;
}

/* Remove Bootstrap's default input focus glow */
.product-list-container .form-control:focus {
    color: inherit;
    border-color: #dee2e6 !important;
    outline: none !important;
    box-shadow: none !important;
}

.category-list-container .form-control:focus {
    color: inherit;
    border-color: #dee2e6 !important;
    outline: none !important;
    box-shadow: none !important;
}

.article-list-container .form-control:focus {
    color: inherit;
    border-color: #dee2e6 !important;
    outline: none !important;
    box-shadow: none !important;
}

#navbarSearchForm .form-control:focus {
    color: inherit;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.show-all-btn {
    height: 45px;
    display: flex;
    align-items: center;
}

.show-all-btn:hover {
    background-color: var(--light-gray);
}

@media (min-width: 992px) {

    .navbar-nav .nav-link:hover,
    .nav-item.dropdown:hover .nav-link {
        color: var(--secondary-text-color);
    }
}

@media (max-width: 991.98px) {
    .navbar-nav .nav-link.show {
        color: var(--secondary-text-color) !important;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(30, 58, 138, 0.7), rgba(30, 58, 138, 0.7)), url('../images/hero-steel.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    padding: 80px 0;
}

/* Page Header */
.page-header {
    /* background: linear-gradient(135deg, #010557 0%, #68a2f3 100%); */
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    /* color: var(--white) !important; */
    color: var(--primary-text-color) !important;
    padding: 60px 0;
}

/* Dynamic background image akan diatur via inline style di HTML */

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.4);
    z-index: 1;
    pointer-events: none;
    /* Allow clicks to pass through */
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-section .btn {
    position: relative;
    z-index: 10 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    border: 1px solid #fff !important;
}

.hero-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.hero-section .btn:focus {
    /* outline: 2px solid #fff; */
    outline-offset: 2px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-image img {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Dropdown Scroll */
.dropdown-menu {
    border: none;
    margin-top: 0 !important;
    max-height: 240px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f4f4f4;
    color: var(--primary-text-color);
}

/* Responsive dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        max-height: 250px;
    }
}

/* Hover dropdown untuk produk */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-item.dropdown .dropdown-menu {
        display: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .nav-item.dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
    }

}

@media (max-width: 991.98px) {

    .nav-item.dropdown.show>.nav-link.dropdown-toggle::after,
    .nav-item.dropdown>.nav-link.dropdown-toggle.show::after,
    .nav-item.dropdown>.nav-link.dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-text-color);
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--gold-accent);
    border-radius: 2px;
}

/* Feature Cards */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--navy-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.feature-card h4 {
    color: var(--primary-text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Product Cards */
.product-card {
    background: white;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card .card-title {
    color: #1e3a8a;
}

.product-image {
    aspect-ratio: 1 / 1;
    /* height: 200px; */
    overflow: hidden;
    background-color: var(--light-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
    -webkit-transform: scale(1.08);
    -moz-transform: scale(1.08);
    -ms-transform: scale(1.08);
    -o-transform: scale(1.08);
}

/* Dark overlay hover effect */
.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
    visibility: visible;
}

.product-overlay .btn-outline-light {
    border: 2px solid #fff;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.product-overlay .btn-outline-light:hover {
    background-color: #fff;
    color: #1e3a8a;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-info h5 {
    color: var(--primary-text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-info p {
    color: var(--primary-text-color);
    font-size: 1rem;
}

.product-info a.btn {
    margin-top: auto;
}

.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.pagination .page-item {
    margin: 0 3px;
}

.pagination .page-link {
    width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    border: 1.5px solid var(--primary-text-color);
    color: var(--primary-text-color);
    background-color: #fff;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-text-color);
    color: #fff;
    border-color: var(--primary-text-color);
    transform: scale(1.05);
}

.pagination .page-item.disabled .page-link {
    color: #bbb;
    border-color: #ddd;
    background-color: #f8f9fa;
}

.pagination .page-link:hover:not(.disabled):not(.active) {
    background-color: var(--primary-text-color);
    color: #fff;
    border-color: var(--primary-text-color);
    transform: translateY(-1px);
}

/* FAQ Section */
.accordion-button {
    background-color: white;
    border: 1px solid #e5e7eb;
    font-weight: 500;
    color: var(--primary-text-color);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border-color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(30, 58, 138, 0.25);
}

.accordion-item {
    border: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    border-radius: 8px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--primary-text-color);
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-outline-light {
    color: var(--primary-text-color);
    background-color: var(--primary-color);
    border-color: var(--primary-text-color);
}

.btn-outline-light:hover {
    color: var(--white);
    background-color: var(--primary-text-color);
    border-color: var(--primary-text-color);
}

/* Footer */
.footer {
    background-color: var(--navy-dark);
}

.footer h5 {
    color: var(--gold-accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--gold-accent) !important;
}

.social-links a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info i {
    color: var(--gold-accent);
    width: 20px;
}

@media (max-width: 768px) {
    .footer-brand > img {
        height: 30px !important;
    }
}

@media (max-width: 576px) {
    .footer-brand > img {
        height: 28px !important;
    }
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-text-color);
    border-color: var(--primary-text-color);
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border-color: var(--primary-text-color);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    background-color: var(--primary-text-color);
    border-color: var(--primary-text-color);
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border-color: var(--primary-text-color);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 50px;
    }

    .hero-section {
        min-height: 50vh;
        padding: 60px 0;
        background-attachment: scroll;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-section h2 {
        font-size: 2rem;
    }

    /* .feature-card,
    .product-card {
        margin-bottom: 1.5rem;
    } */
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 40vh;
        padding: 40px 0;
        background-attachment: scroll;
    }

    .hero-title {
        font-size: 2rem;
    }

    .top-bar .contact-info span {
        display: block;
        margin-bottom: 5px;
    }

    .top-bar .col-md-6.text-end {
        text-align: left !important;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Social Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    border: 2px solid transparent;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.social-share-btn.facebook {
    background-color: #1877f2;
    color: white;
}

.social-share-btn.facebook:hover {
    background-color: #166fe5;
    color: white;
}

.social-share-btn.twitter {
    background-color: #000000;
    color: white;
}

.social-share-btn.twitter:hover {
    background-color: #333333;
    color: white;
}

.social-share-btn.whatsapp {
    background-color: #25d366;
    color: white;
}

.social-share-btn.whatsapp:hover {
    background-color: #22c55e;
    color: white;
}

.social-share-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.social-share-btn.instagram:hover {
    background: linear-gradient(45deg, #f39c42 0%, #e8734a 25%, #e02d47 50%, #d12d6a 75%, #c11d8c 100%);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .share-buttons {
        justify-content: center;
        margin-top: 15px;
    }

    .social-share-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .add-custom-btn {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
}

/* Footer icon */
.separator {
    display: inline-block;
    width: 2px;
    height: 1.5em;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
    vertical-align: middle;
}

/* Navbar Toggler Customization */
.navbar-toggler {
    border-width: 2px;
    border-color: rgba(0, 0, 0, 0.5);
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}