:root {
    /* Color Palette - Purple Gradient Theme */
    --primary-color: #6c5ce7;
    --primary-hover: #5649d1;
    --secondary-color: #a29bfe;
    --accent-color: #00cec9;
    --success-color: #00b894;
    --error-color: #ff7675;
    --warning-color: #fdcb6e;
    
    /* Light Mode */
    --background-color: #f8f9fd; /* Slightly off-white */
    --card-background: #ffffff;
    --text-color: #2d3436;
    --text-muted: #636e72;
    --border-color: rgba(0, 0, 0, 0.08);
    --highlight-color: rgba(108, 92, 231, 0.1); /* Lighter highlight */
    
    /* UI Elements */
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.05); /* Softer shadow */
    --hover-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --hover-transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    --hover-transform: translateY(-5px);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    
    /* Layout */
    --side-nav-width: 260px; /* Slightly wider */
    --side-nav-collapsed: 70px;
    --header-height: 70px;
    
    /* Background values for rgba */
    --background-color-rgb: 248, 249, 253;
}

.dark-mode {
    --primary-color: #a29bfe;
    --primary-hover: #8983d8;
    --secondary-color: #6c5ce7;
    --accent-color: #00cec9;
    --background-color: #1a1b2e; /* Darker background */
    --card-background: #252640; /* Slightly darker card */
    --text-color: #e5e5e5;
    --text-muted: #b2becd;
    --border-color: rgba(255, 255, 255, 0.08);
    --highlight-color: rgba(162, 155, 254, 0.15); /* Dark mode highlight */
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --background-color-rgb: 26, 27, 46;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: calc(var(--header-height) + 20px); /* Added padding for better scroll targetting */
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6; /* Slightly more line height */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smoother theme transition */
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75em; /* Consistent margin */
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none; /* Ensure no underline on hover unless intended */
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; /* Standard property */
    text-fill-color: transparent; /* Standard property */
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--hover-transition);
    padding: 0.6rem 1.3rem; /* Slightly adjusted padding */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    text-transform: capitalize; /* Example: capitalize button text */
}

.btn:focus, .btn:active { /* Combined focus and active */
    outline: none;
    box-shadow: 0 0 0 3px var(--highlight-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}

.btn-primary:hover {
    transform: var(--hover-transform);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.3);
    color: white; /* Ensure color stays white on hover */
}

.btn-primary:active {
    transform: translateY(-2px); /* Keep active effect */
}

.btn-primary:disabled, .btn-primary.disabled { /* Added .disabled class */
    background: linear-gradient(135deg, #b0b0eb, #c3c0eb); /* More muted disabled */
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-active { /* Class for submit button when inputs are valid */
    background: linear-gradient(135deg, var(--success-color), #00d1a7) !important;
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3) !important;
}
.btn-active:hover {
    box-shadow: 0 6px 15px rgba(0, 184, 148, 0.4) !important;
}


/* Badge */
.badge-pill {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.3rem 0.8rem; /* Adjusted padding */
    font-size: 0.8rem; /* Slightly larger */
    border-radius: 100px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    white-space: nowrap;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.5s ease-out forwards; }


@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.slide-in-up { animation: slideInUp 0.5s ease-out forwards; }


@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pulse-animation { animation: pulse 0.3s ease-in-out; }


@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake-animation { animation: shake 0.4s ease-in-out; }


@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* New Spinner Animation */
@keyframes dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124; }
}

@keyframes rotate-spinner {
    100% { transform: rotate(360deg); }
}

/* Layout Structure */
.main-wrapper {
    min-height: 100vh;
    margin-left: var(--side-nav-width);
    transition: margin-left 0.3s ease; /* Smooth transition for margin */
    display: flex;
    flex-direction: column;
}

.main-wrapper.nav-collapsed {
    margin-left: var(--side-nav-collapsed);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--side-nav-width);
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease; /* Added transform transition for mobile */
    display: flex;
    flex-direction: column;
    padding: var(--space-lg) 0;
    overflow-x: hidden;
}

.side-nav.collapsed {
    width: var(--side-nav-collapsed);
}

.side-nav-logo {
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-xl); /* More margin */
    gap: 10px;
}

.side-nav-logo #sideNavName {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Smooth hide/show */
}

.side-nav.collapsed .side-nav-logo {
    justify-content: center;
    padding: 0;
}

.side-nav.collapsed .side-nav-logo #sideNavName,
.side-nav.collapsed #versionHeader {
    opacity: 0;
    visibility: hidden;
    display: none; /* Ensure it doesn't take space */
}

.side-nav-links {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow links to take available space */
}

.side-nav-link {
    display: flex;
    align-items: center;
    padding: 14px var(--space-lg); /* Increased padding */
    color: var(--text-muted);
    transition: var(--transition);
    margin: var(--space-xs) 0;
    border-left: 4px solid transparent; /* Thicker border */
    gap: var(--space-md); /* Increased gap */
}

.side-nav-link i {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}
.side-nav-link:hover i {
    transform: scale(1.1);
}


.side-nav-link:hover, .side-nav-link.active {
    color: var(--primary-color);
    background-color: var(--highlight-color);
    border-left-color: var(--primary-color);
}

.side-nav.collapsed .side-nav-link {
    justify-content: center;
    padding: 14px 0;
}

.side-nav.collapsed .side-nav-link span {
    display: none;
}

.nav-collapse-btn {
    position: absolute;
    top: calc(var(--header-height) + 20px); /* Align with header bottom */
    right: -16px;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 10;
}

.nav-collapse-btn:hover {
    transform: scale(1.1) rotate(5deg); /* Added slight rotation */
}

.side-nav.collapsed .nav-collapse-btn i {
    transform: rotate(180deg);
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    z-index: 100; /* Ensure header is above side-nav collapse button */
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: none; /* Hidden by default, shown in media query */
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.search-container {
    max-width: 500px;
    width: 100%;
    margin: 0 var(--space-md);
    flex-grow: 1;
    min-width: 150px; /* Prevent it from becoming too small */
    transition: max-width 0.3s ease, margin 0.3s ease;
}

.input-group {
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    transition: var(--hover-transition);
    background-color: var(--background-color); /* Match body background */
    border: 1px solid var(--border-color); /* Subtle border */
}

.input-group:focus-within, .search-focused { /* Added .search-focused for JS control */
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
    border-color: var(--primary-color); /* Highlight border on focus */
}

.input-group-text {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    padding-left: var(--space-md);
}

#searchInput {
    border: none;
    padding: 12px var(--space-md);
    font-size: 1rem;
    background-color: transparent;
    color: var(--text-color);
    flex: 1;
    width: 100%; /* Ensure it takes full width within its container */
}

#searchInput:focus {
    box-shadow: none;
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0; /* Controlled by JS */
    pointer-events: none; /* Controlled by JS */
    transition: opacity 0.2s ease, color 0.2s ease;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-search:hover {
    color: var(--primary-color);
    background-color: var(--highlight-color);
}

.header-actions {
    margin-left: auto; /* Pushes actions to the right */
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
}

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 50%;
}

.notification-bell:hover {
    color: var(--primary-color);
    background-color: var(--highlight-color);
}

.notification-badge {
    position: absolute;
    top: 2px; /* Adjusted position */
    right: 2px; /* Adjusted position */
    width: 18px;
    height: 18px;
    background-color: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Hero Section (Main page hero, not the card) */
section#home.hero-section { 
    display: flex;
    /* MODIFIED: Default to column for easier override in desktop media query */
    flex-direction: column; 
    align-items: center; /* Center content horizontally */
    text-align: center; /* Center text within .hero-content */
    padding: var(--space-xl) var(--space-md); /* Default padding for mobile-first */
    position: relative;
    overflow: hidden; 
    min-height: auto; /* Let content dictate height initially */
}

.hero-content {
    /* MODIFIED: Take full width and let text-align center it */
    width: 100%; 
    max-width: 600px; /* Still cap content width */
    animation: slideInLeft 0.8s ease-out forwards; /* Keep animation */
    position: relative;
    z-index: 5;
    margin-bottom: var(--space-lg); /* Space between text content and banner */
}

.hero-heading {
    display: flex;
    align-items: center;
    justify-content: center; /* Center heading items */
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

#name {
    font-size: clamp(2rem, 6vw, 2.8rem); /* Adjusted for mobile first */
    font-weight: 800;
    margin-bottom: 0;
}
#version { /* Ensure version badge is visible and spaced */
    margin-left: var(--space-sm);
}


.hero-description {
    font-size: clamp(0.9rem, 3vw, 1.1rem); /* Adjusted for mobile first */
    color: var(--text-muted);
    margin-bottom: var(--space-lg); /* Space before action buttons */
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center; /* Center action buttons */
    margin-bottom: var(--space-lg); /* Space after action buttons, before banner */
}

.hero-actions .api-link {
    animation: slideInUp 0.5s ease-out forwards;
}

.hero-actions .api-link:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
}

.hero-actions .api-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.hero-actions .api-link:hover::before {
    transform: translateX(100%);
}

/* Hero Visual and Banner Styling */
.hero-visual {
    width: 100%; /* Take full width available */
    max-width: 480px; /* Max width for the banner on mobile/tablet */
    margin: 0 auto; /* Center the visual block */
    position: relative;
    z-index: 2;
    animation: fadeIn 0.8s 0.2s ease-out forwards; /* Fade in after text */
    opacity: 0; /* Start hidden for animation */
    padding-bottom: var(--space-lg); /* Space below banner */
}

.banner-container {
    width: 100%;
    border-radius: var(--border-radius); /* Consistent radius */
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    position: relative;
    z-index: 3;
    background-color: var(--card-background); 
    cursor: pointer; /* Indicate it's clickable */
    /* Initial tilt for mobile/tablet - will be overridden for desktop */
    transform: rotate(2deg); 
}

.banner-container.is-straight { /* Class added by JS on click */
    transform: rotate(0deg) !important; /* Straighten and override initial tilt */
    box-shadow: var(--hover-shadow); /* Add hover shadow when straight */
}


.banner { 
    display: block; 
    width: 100%;
    height: auto; /* Let image aspect ratio determine height */
    max-height: 200px; /* MODIFIED: Control max height to look like "Gambar 2" */
    object-fit: contain; /* MODIFIED: Ensure full image is visible */
    object-position: center; 
    transition: transform 0.5s ease;
}

/* Shapes are hidden by default for mobile-first, shown on desktop */
.shape { display: none; }


/* --- DESKTOP STYLES for HERO SECTION --- */
@media (min-width: 992px) { /* Apply from tablet landscape upwards */
    section#home.hero-section {
        flex-direction: row; /* Side by side on desktop */
        text-align: left; /* Align text to left */
        padding: var(--space-xxl) var(--space-xl); 
        min-height: calc(100vh - var(--header-height)); /* Restore min-height */
        align-items: center; /* Vertically align content and visual */
    }

    .hero-content {
        width: auto; /* Allow flex to determine width */
        max-width: 55%; /* Give more space to text content */
        margin-bottom: 0; /* Remove bottom margin */
        animation: slideInLeft 0.8s ease-out forwards;
    }
    .hero-heading {
        justify-content: flex-start; /* Align heading to left */
    }
    #name {
        font-size: clamp(2.5rem, 5vw, 3.5rem); 
    }
    .hero-description {
        font-size: clamp(1rem, 2.5vw, 1.25rem); 
        margin-bottom: var(--space-xl);
    }
    .hero-actions {
        justify-content: flex-start; /* Align buttons to left */
        margin-bottom: 0;
    }

    .hero-visual {
        width: auto; /* Allow flex to determine width */
        max-width: 45%; /* Space for visual */
        margin: 0; /* Reset margin */
        padding: var(--space-md) 0 var(--space-md) var(--space-lg); /* Padding on the left of visual */
        animation: slideInRight 0.8s ease-out forwards;
        opacity: 1; /* Ensure visible */
        max-height: 450px; /* Restore max height for desktop */
    }

    .banner-container {
        width: clamp(320px, 100%, 550px); /* Desktop banner width */
        aspect-ratio: 16 / 9; /* Restore aspect ratio for desktop if desired */
        transform: rotate(3deg); /* Initial tilt for desktop */
        cursor: default; /* No special cursor for desktop unless :hover */
    }
    .banner-container:hover { /* Desktop hover effect */
        transform: rotate(0deg) translateY(-10px);
        box-shadow: var(--hover-shadow);
    }
    .banner-container.is-straight { /* If JS class is applied, ensure it doesn't conflict with hover */
        transform: rotate(0deg) translateY(-10px) !important;
    }

    .banner {
        max-height: none; /* Remove max-height constraint from mobile */
        object-fit: cover; /* Back to cover for desktop if aspect-ratio is set */
        height: 100%;
    }

    .shape { display: block; } /* Show shapes on desktop */
}


/* API Section */
.api-section {
    padding: var(--space-xxl) var(--space-xl);
    background-color: var(--background-color);
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-md);
    position: relative;
    display: inline-block;
    color: var(--text-color);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

.section-description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    max-width: 800px;
}

/* Category Section */
.category-section {
    margin-bottom: var(--space-xxl);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.category-section.in-view {
    opacity: 1;
    transform: translateY(0);
}


.category-header {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-color);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding-left: var(--space-sm);
    border-left: 4px solid var(--primary-color);
}
.category-header i {
    color: var(--primary-color);
}


.category-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow);
    transition: var(--hover-transition);
}

.category-image:hover {
    transform: scale(1.02);
    box-shadow: var(--hover-shadow);
}

/* API Cards - Using .api-card-layout */
.api-item {
    margin-bottom: var(--space-lg);
    padding: 0 var(--space-sm);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 0;
    transform: translateY(20px);
}

.api-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

.api-card-layout {
    padding: var(--space-lg);
    background-color: var(--card-background);
    color: var(--text-color);
    border-radius: var(--border-radius);
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    transition: var(--hover-transition);
    border: 1px solid var(--border-color);
    position: relative;
    height: 100%;
}

.api-card-layout::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 50px 50px 0;
    border-color: transparent var(--highlight-color) transparent transparent;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
}

.api-card-layout:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-5px);
}

.api-card-layout:hover::after {
    opacity: 1;
}

.api-card-info {
   flex-grow: 1;
   margin-bottom: var(--space-md);
}

.api-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    transition: var(--transition);
    color: var(--text-color);
    word-break: break-word;
    overflow-wrap: break-word;
}
.api-card-layout:hover .api-card-title {
    color: var(--primary-color);
}


.api-card-desc {
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    margin-bottom: 0;
}

.api-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
}

.get-api-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white !important;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 10px 18px;
    transition: var(--hover-transition);
    font-weight: 500;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
}

.get-api-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.get-api-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.get-api-btn:hover::before {
    transform: translateX(100%);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 50px;
    white-space: nowrap;
    text-transform: capitalize;
}

.status-ready { background-color: rgba(0, 184, 148, 0.15); color: var(--success-color); }
.status-error { background-color: rgba(255, 118, 117, 0.15); color: var(--error-color); }
.status-update { background-color: rgba(253, 203, 110, 0.15); color: var(--warning-color); }

.api-status i { font-size: 8px; }
.api-status span { margin-left: 3px; }

/* Search match highlighting */
.search-match-header, .search-match-item {
    transition: background-color 0.3s ease;
    background-color: var(--highlight-color) !important;
    border-radius: var(--border-radius-sm);
}
.search-match-item .api-card-layout {
    background-color: var(--card-background) !important;
}


/* No Results Message */
.no-results-message, .no-results-message-simplified {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xxl) var(--space-lg);
    text-align: center;
    animation: fadeIn 0.4s ease-in-out forwards;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-top: var(--space-xl);
    color: var(--text-muted);
}

.no-results-message i.fa-database {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.no-results-message p {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
}

.no-results-message-simplified {
    padding: var(--space-lg);
    font-size: 1.1rem;
}


/* Footer */
.main-footer {
    margin-top: auto;
    padding: var(--space-lg) var(--space-xl);
    background-color: var(--card-background);
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.copyright { font-size: 0.9rem; }

.footer-middle { display: flex; align-items: center; }

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.footer-links { display: flex; gap: var(--space-md); }
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}
.footer-link:hover { color: var(--primary-color); background-color: var(--highlight-color); }

/* Modal */
.modal-content {
    background-color: var(--card-background);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.modal-header > div {
    margin-right: var(--space-md);
}


.modal-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.25rem;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.btn-close {
    color: var(--text-color);
    opacity: 0.7;
    transition: var(--transition);
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 50%;
}
.btn-close:hover {
    opacity: 1;
    color: var(--primary-color);
    background-color: var(--highlight-color);
}
.btn-close:focus {
    box-shadow: 0 0 0 0.25rem var(--highlight-color);
}


.modal-body {
    max-height: 65vh;
    overflow-y: auto;
    padding: var(--space-lg) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--card-background);
}
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-track { background: var(--card-background); border-radius: 10px; }
.modal-body::-webkit-scrollbar-thumb { background: linear-gradient(var(--primary-color), var(--secondary-color)); border-radius: 10px; }

.endpoint-container, .response-container {
    margin-bottom: var(--space-lg);
}

.endpoint-label, .response-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--text-color);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.copy-btn:hover { color: var(--primary-color); background-color: var(--highlight-color); }
.copy-success { color: var(--success-color) !important; }

.code-block {
    background-color: var(--background-color);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
    position: relative;
    line-height: 1.6;
    white-space: pre;
}

/* Query Input Container */
.query-input-container { margin-bottom: var(--space-lg); }

.param-container {
    margin-bottom: var(--space-lg);
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
}

.param-form-title {
    margin-bottom: var(--space-lg);
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
}
.param-form-title i { color: var(--primary-color); }

.param-group { margin-bottom: var(--space-md); position: relative; }
.param-group:last-child { margin-bottom: 0; }


.param-label-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.form-label { color: var(--text-color); font-weight: 500; margin-bottom: 0; }
.required-indicator { color: var(--error-color); font-weight: bold; margin-left: 2px; }

.param-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: help;
    transition: var(--transition);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.param-info:hover { color: var(--primary-color); background-color: var(--highlight-color); }

.input-container { position: relative; }

.custom-input {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    width: 100%;
    font-size: 0.95rem;
}
.custom-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--highlight-color);
}
.custom-input.is-invalid {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 118, 117, 0.1) !important;
}
.custom-input::placeholder { color: var(--text-muted); opacity: 0.7; }


.inner-desc {
    background-color: var(--highlight-color);
    color: var(--text-color);
    padding: var(--space-md);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    margin-top: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    border-left: 3px solid var(--primary-color);
}
.inner-desc i { color: var(--primary-color); margin-top: 2px; }

/* Loading Spinner - New Style */
#apiResponseLoading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}
#apiResponseLoading p { color: var(--text-muted); font-weight: 500; margin-bottom: 0; }

.spinner-logo { animation: rotate-spinner 2s linear infinite; }
.spinner-path { stroke: var(--highlight-color); stroke-linecap: round; }
.spinner-animation { stroke: var(--primary-color); stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }

/* Loading Screen */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.5s ease;
}
.spinner-wrapper { text-align: center; }
.spinner-wrapper p {
    color: var(--text-color);
    font-weight: 500;
    margin-top: var(--space-lg);
    font-size: 1.1rem;
    letter-spacing: 1px;
}
.loading-dots { display: inline-block; width: 20px; text-align: left; }
.fade-out { opacity: 0; pointer-events: none; }
.slide-in-bottom { animation: slideInUp 0.5s ease-out forwards; }


/* Toast Notification */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1060; }
.toast {
    background-color: var(--card-background);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow);
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
    max-width: 90vw;
}
.toast-header {
    background-color: transparent;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 15px;
}
.toast-icon { /* Color set by JS */ }
.toast-title { font-weight: 600; }
.toast-body { padding: 15px; font-size: 0.9rem; }

/* JSON Syntax Highlighting */
.json-string { color: var(--success-color); }
.json-number { color: var(--accent-color); }
.json-boolean { color: var(--primary-color); }
.json-null { color: var(--error-color); }
.json-key { color: var(--warning-color); }

.dark-mode .json-string { color: #7ee787; }
.dark-mode .json-number { color: #79c0ff; }
.dark-mode .json-boolean { color: #ff7b72; }
.dark-mode .json-null { color: #ff7b72; }
.dark-mode .json-key { color: #ffa657; }

/* Code Folding in Modal */
.code-fold-trigger {
    cursor: pointer;
    position: relative;
    padding-left: 20px !important;
    transition: background-color 0.2s ease;
    display: block;
    line-height: 1.5;
}
.code-fold-trigger:hover {
    background-color: var(--highlight-color);
}
.code-fold-trigger::before {
    content: "\f078"; 
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.2s ease;
    font-size: 0.8em;
    color: var(--text-muted);
}
.code-fold-trigger.folded::before {
    transform: translateY(-50%) rotate(-90deg);
}
.fold-indicator {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-left: 8px;
}
.code-fold-content {
    padding-left: 20px !important;
    border-left: 1px dashed var(--border-color);
    margin-left: 9px;
    line-height: 1.5;
}
.code-fold-trigger.folded + .code-fold-content {
    display: none;
}

/* Response Image in Modal */
.response-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow);
    margin: 0 auto var(--space-md) auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.response-image:hover {
    transform: scale(1.02);
    box-shadow: var(--hover-shadow);
}

/* Error Container in Modal */
.error-container {
    padding: var(--space-md);
    border: 1px solid var(--error-color);
    border-radius: var(--border-radius-sm);
    background-color: rgba(255, 118, 117, 0.05);
}
.error-container .fa-exclamation-circle {
    font-size: 1.5rem;
}
.error-container h6 { color: var(--error-color); }
.error-container p { word-break: break-word; }


/* Responsive Styles for Mobile and Tablet (Hero Section Focus) */

@media (max-width: 991px) { /* Target tablet portrait and mobile */
    .main-wrapper { margin-left: 0; }
    .side-nav { transform: translateX(-100%); }
    .side-nav.active { transform: translateX(0); box-shadow: var(--hover-shadow); }
    .menu-toggle { display: block; }
    .nav-collapse-btn { display: none; }
    
    .search-container { max-width: 300px; flex-grow: 1; }
    
    .modal-dialog { margin: 10px; max-width: calc(100% - 20px); }
    .section-title { font-size: clamp(1.8rem, 3.5vw, 2rem); }

    .api-card-layout { padding: var(--space-md); }
    .api-card-title { font-size: 1.05rem; }
    .api-card-desc { font-size: 0.85rem; -webkit-line-clamp: 2; }
    .get-api-btn { padding: 8px 14px; font-size: 0.85rem; }
    .api-actions { flex-direction: row; }

    /* Shapes hidden for tablet and mobile by default hero-visual style */
    .shape { display: none; }
}


@media (max-width: 768px) { /* Specific adjustments for smaller tablets / large phones */
    section#home.hero-section {
        padding-top: var(--space-lg); 
        padding-bottom: var(--space-lg);
    }
    #name { font-size: clamp(1.8rem, 5.5vw, 2.2rem); } 
    .hero-description { font-size: clamp(0.85rem, 2.8vw, 1rem); margin-bottom: var(--space-lg); } 
    .hero-actions { flex-direction: column; align-items: center; } 
    .hero-actions .api-link { width: 100%; max-width: 280px; text-align: center; } 
    
    .search-container { max-width: none; margin: 0 var(--space-sm); }
    .main-header { padding: 0 var(--space-md); }

    .footer-content { flex-direction: column; text-align: center; gap: var(--space-lg); }
    .footer-links { justify-content: center; }

    .category-header { font-size: clamp(1.3rem, 2.8vw, 1.5rem); }
    .col-md-6.api-item { width: 100%; flex: 0 0 100%; max-width: 100%; }

    .hero-visual {
        max-width: 420px; 
        max-height: 180px; 
        margin-bottom: var(--space-md);
    }
    .banner-container {
        border-radius: var(--border-radius-sm); 
    }
}

@media (max-width: 576px) { /* Specific adjustments for phones */
    html { font-size: 15px; } 
    .main-header { padding: 0 var(--space-sm); }
    .search-container { margin: 0 var(--space-xs) 0 var(--space-sm); } 
    .header-actions .notification-bell { width: 36px; height: 36px; font-size: 1.1rem; }
    .notification-badge { width: 16px; height: 16px; font-size: 10px; top: 1px; right: 1px; }

    #name { font-size: clamp(1.7rem, 6vw, 2rem); } 
    .hero-description { font-size: clamp(0.8rem, 3vw, 0.95rem); } 
    
    .api-section, section#home.hero-section { padding: var(--space-md) var(--space-sm); } 
    .section-title { font-size: clamp(1.4rem, 3.8vw, 1.7rem); } 
    .section-description { font-size: clamp(0.85rem, 2.5vw, 0.95rem); } 
    
    .api-actions { flex-direction: column; gap: var(--space-sm); align-items: stretch; }
    .get-api-btn { width: 100%; }
    .api-status { width: 100%; justify-content: center; }

    .toast-container { left: 10px; right: 10px; bottom: 10px; width: auto; }
    .toast { min-width: unset; width: 100%; }
    .modal-footer .btn { width: 100%; margin-top: var(--space-sm); }
    .modal-footer { flex-direction: column; }

    .hero-visual {
        max-height: 160px; /* Even smaller max height for small phones */
        margin-bottom: var(--space-sm);
    }
     .banner-container {
        transform: rotate(1.5deg); /* Slightly less tilt for small phones */
    }
    .banner-container.is-straight {
        transform: rotate(0deg) !important;
    }
}
