/* Base styles */
html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --primary-color: #1a73e8;
    --secondary-color: #f0f0f0;
    --header-bg: #f1f5f9;
    --footer-bg: #0f172a;
    --footer-text: #ffffff;
    --section-odd-bg: rgba(241, 245, 249, 0.5);
    --section-even-bg: rgba(255, 255, 255, 0.7);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #2c3e50;
    --text-color: #f0f0f0;
    --primary-color: #4285f4;
    --secondary-color: #2d2d2d;
    --header-bg: #0f172a;
    --section-odd-bg: rgba(15, 23, 42, 0.5);
    --section-even-bg: rgba(30, 41, 59, 0.7);
}

/* Dark mode adjustments - Modified */
[data-theme="dark"] .section-bg {
    background-color: var(--section-odd-bg);
}

[data-theme="dark"] .section:nth-child(even) .section-bg {
    background-color: var(--section-even-bg);
}

[data-theme="dark"] .grid-item {
    background-color: var(--secondary-color);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .grid-item:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .slide-content {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

[data-theme="dark"] .slide-content p {
    color: var(--text-color);
}

/* Global styles */
body {
    font-family: "Roboto", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px; /* Add padding for spacing */
}

/* Section styles - Modified */
.section {
    position: relative;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Full-width background element - Modified */
.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    z-index: -1;
}

/* Alternating background colors - Modified */
.section:nth-child(odd) .section-bg {
    background-color: var(--section-odd-bg);
}

.section:nth-child(even) .section-bg {
    background-color: var(--section-even-bg);
}

.section h2 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Top Bar Styles */
.top-bar-bg {
    width: 100%;
    background-color: var(--header-bg);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem; /* smaller font size */
    position: relative;
    margin: 0 auto;
    padding: 15px 2rem;
}

.date-info {
    flex: 1;
    /* Allow date to stay on the left */
    color: var(--text-color);
    /* Ensure text color fits the theme */
    font-weight: 300;
}

#time-info-collapsible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.waktu-info-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* space between the elements */
}

.waktu-indo {
    color: var(--text-color);
    font-weight: 300;
    font-size: 0.8rem;
}

.waktu-indo:hover {
    color: #007bff;
    /* Bootstrap blue, or specify your preferred blue color */
}

.waktu-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.waktu-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.time-info {
    display: flex;
    align-items: center;
    color: green;
    /* Change time color to green */
    gap: 0.5rem;
    font-weight: bold;
}

.time-info span {
    white-space: nowrap;
    color: green;
    /* Ensure time is green */
}

/* Dropdown button for mobile */
.top-bar-dropdown {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Header styles */
.header-bg {
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1200;
    /* Sticky header above content */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    /* Add this for mobile menu positioning */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title p {
    margin: 0;
    font-size: 0.6rem;
    color: var(--text-color);
    opacity: 0.8;
}

.header-title h1 {
    margin: 0.2rem 0 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

nav a:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

nav a:hover:after {
    width: 100%;
}

/* Hero styles */
.hero {
    text-align: center;
    /* Center align the hero text */
    margin: 2rem 0;
    background-color: transparent !important;
}

/* Hero exception */
.hero .section-bg {
    display: none;
}

.hero::before {
    display: none;
}

.hero h2 {
    font-size: 1.8rem;
    margin: 1rem 0;
}

.hero p {
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Grid Container for Services */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.grid-item {
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.slide-content {
    padding: 1.5rem;
    text-align: center;
}

.slide-content img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.grid-item:hover .slide-content img {
    transform: scale(1.03);
}

.slide-content p {
    margin: 0;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1rem;
}

/* Header Logo and Images */
.header-logo,
.footer-logo,
.hero-image {
    max-width: 100%;
    height: auto;
}

.header-logo {
    max-height: 80px;
}

.footer-logo {
    max-height: 60px;
}

.hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

/* SVG and Icon Sizing */
svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    color: var(--text-color);
}

.social-icon svg {
    width: 24px;
    height: 24px;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Contact Button Styles */
.contact-wrapper {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 7px 14px;
    background-color: var(--bg-color);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0px 8px 32px 0px rgba(100, 116, 139, 0.06);
    transition: all 0.2s ease;
}

.contact-button:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #f0f0f0;
}

.contact-button svg {
    width: 1rem;
    height: 1rem;
}

/* Hamburger Icon (for menu toggle) */
.hamburger-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-icon div {
    background-color: var(--text-color);
    position: absolute;
    height: 3px;
    width: 100%;
    transition: transform 0.3s;
}

.hamburger-icon div:nth-child(1) {
    top: 0;
}

.hamburger-icon div:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-icon div:nth-child(3) {
    bottom: 0;
}

/* Active state for hamburger icon (when menu is open) */
.menu-toggle.active .hamburger-icon div:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active .hamburger-icon div:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-icon div:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Footer Styles */
/* Footer Styling Updates */
.footer-bg {
    background-color: var(--footer-bg);
    padding-top: 3rem;
    padding-bottom: 1rem;
}

/* Add padding inside the container in footer-bg to control horizontal spacing if needed */
.footer-bg .container {
    padding-left: 15px;
    /* optional, consistent with other containers */
    padding-right: 15px;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-column h4 {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 0;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: #ffffff;
}

.footer-logo-container {}

.footer-org {
    color: #fff;
    font-weight: 700;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.footer-desc {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.75rem;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.contact-list svg {
    flex-shrink: 0;
    color: #fff;
    width: 24px;
    height: 24px;
    margin-top: 3px;
}

.contact-list span {
    color: #fff;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.5;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    margin-bottom: 0.75rem;
}

.link-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.link-list a:hover {
    color: rgba(255, 255, 255, 0.56);
}

.link-list a::after {
    content: "↗";
    display: inline-block;
    transition: transform 0.2s;
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.link-list a:hover::after {
    transform: translateX(3px);
}

.social-media {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.cert-logos {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.875rem;
    font-weight: 500;
}

.back-to-top-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
    background-color: #fff;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.back-to-top-button:hover {
    background-color: #f0f0f0;
}

.back-to-top-button svg {
    width: 16px;
    height: 16px;
    color: #0f172a;
}

/* Make app-store-buttons inline (horizontal) */
.app-store-buttons {
    display: flex;
    /* override previous column layout */
    flex-direction: row;
    /* ensure horizontal layout */
    gap: 1rem;
    /* space between buttons */
    align-items: center;
    /* align vertically */
}

.app-store-buttons a {
    display: block;
}

.app-store-buttons svg {
    width: 120px;
    height: 40px;
}

/* Responsive adjustments */
@media (max-width: 1280px) {
    .contact-wrapper {
        justify-content: flex-start;
    }
}

@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-title {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-bar {
        font-size: 0.7rem;
        /* even smaller for mobile */
        flex-wrap: wrap;
        padding-left: 15px;
        padding-right: 15px;
    }

    .time-info {
        justify-content: left;
        width: 100%;
    }

    /* Update #time-info-collapsible styles to ensure smooth transition */

    #time-info-collapsible {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0.25rem;
        justify-content: center;
        flex-wrap: wrap;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        font-size: 0.7rem;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }

    #time-info-collapsible.active {
        max-height: 100px;
        /* enough height for content */
        opacity: 1;
    }

    .waktu-indo {
        margin-top: 0.75rem;
        width: 100%;
        text-decoration: none;
    }

    .top-bar-dropdown {
        display: block;
        position: absolute;
        right: 0;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    header {
        padding: 0 0.5rem;
    }

    .contact-button {
        order: 1;
        /* Place before hamburger (order: 2) */
        margin-left: auto;
        /* Push to the right */
        font-size: 0.625rem;
    }

    /* Footer main - stack columns vertically */
    .footer-main {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    /* Footer columns full width */
    .footer-column {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    /* Footer bottom: stack vertically */
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        text-align: center;
    }

    /* Back to top button full width with some margin */
    .back-to-top-button {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        padding: 0.75rem 0;
    }

    /* Hide header-title on mobile */
    .header-title {
        display: none;
    }

    /* Show hamburger menu button */
    .menu-toggle {
        order: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        width: 40px;
        height: 40px;
        position: relative;
        z-index: 1100;
    }

    /* Style hamburger icons inside the button */
    #menu-toggle .icon-open,
    #menu-toggle .icon-close {
        display: flex;
        align-items: center;
        justify-content: center;
        fill: var(--text-color);
    }

    /* Show hamburger open icon by default */
    #menu-toggle .icon-close {
        display: none;
    }

    /* When active toggle, swap icon display */
    #menu-toggle.active .icon-open {
        display: none;
    }

    #menu-toggle.active .icon-close {
        display: flex;
    }

    /* Mobile menu styles */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        background-color: var(--header-bg);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    .mobile-menu.active {
        max-height: 500px;
        /* Adjust based on your content height */
        opacity: 1;
        padding: 1rem 0;
    }

    /* Mobile menu links */
    .mobile-menu a {
        color: var(--text-color);
        padding: 0.75rem 1.5rem;
        text-decoration: none;
        font-weight: 600;
        transition: background-color 0.2s;
        transform: translateY(-20px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-menu.active a {
        transform: translateY(0);
        opacity: 1;
        transition-delay: calc(var(--i) * 0.1s);
    }

    /* Hide desktop nav menu */
    nav {
        display: none;
    }

    .mobile-menu a:hover {
        background-color: var(--primary-color);
        color: #fff;
    }

    /* Ensure full width on mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Hide hamburger and mobile menu on desktop */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }

    .mobile-menu {
        display: none !important;
    }

    nav {
        display: flex !important;
    }
}

@media (min-width: 1025px) {
    .header-title {
        display: flex !important;
    }
}