* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 3rem 2rem;
    background: var(--header-gradient);
    border-radius: 20px;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.header-title {
    margin-bottom: 2rem;
}

.title-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.title-animation h1 {
    font-size: 2.8rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: titlePulse 2s infinite;
}

.emoji-left, .emoji-right {
    font-size: 2.5rem;
    animation: emojiWave 2s infinite;
}

.emoji-right {
    animation-delay: 0.5s;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes emojiWave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.header-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.badge {
    background: var(--badge-bg);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.badge-icon {
    font-size: 1.2rem;
}

.badge-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-text);
}

.creator-info {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.creator-info p {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.creator-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.creator-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.creator-icon {
    font-size: 1.1rem;
}

.creator-name {
    font-weight: bold;
}

.creator-divider {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.ai-credit {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .main-header {
        padding: 2rem 1rem;
    }

    .title-animation h1 {
        font-size: 2rem;
    }

    .header-badges {
        gap: 1rem;
    }

    .badge {
        padding: 0.6rem 1rem;
    }

    .creator-info p {
        flex-direction: column;
        gap: 0.8rem;
    }

    .creator-divider {
        display: none;
    }
}

.main-header:hover {
    transform: translateY(-5px);
}

.main-header h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Intro Box */
.intro-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px var(--card-shadow);
}

.intro-content {
    text-align: center;
}

.intro-text {
    font-size: 1.2rem;
    color: var(--secondary-text);
    margin: 1rem 0;
}

.number-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.number-type {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.number-type:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.number-type h3 {
    color: #6366f1;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.example {
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    font-weight: bold;
    color: #6366f1;
}

/* Converter Box */
.converter-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 2px 15px var(--card-shadow);
    margin-bottom: 2rem;
}

.main-input {
    background: var(--input-bg);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.result-group {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.result-group:hover {
    transform: translateY(-5px);
}

.result-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.icon {
    font-size: 1.5rem;
}

/* Input Styles */
input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input[readonly] {
    background: #f1f5f9;
    cursor: not-allowed;
}

.input-hint {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* Visualization */
.binary-vis, .hex-vis, .octal-vis {
    margin-top: 1rem;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.bit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.bit-1 {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.bit-0 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Explanation Tabs */
.explanation-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn.active {
    background: #6366f1;
    color: white;
}

/* Fun Facts */
.fun-facts {
    margin-top: 3rem;
}

.fact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.fact-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px var(--card-shadow);
    transition: transform 0.3s ease;
}

.fact-card:hover {
    transform: translateY(-5px);
}

.fact-card h3 {
    color: #6366f1;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.fact-card p {
    color: var(--secondary-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0;
    }

    .main-header {
        padding: 2rem 1rem;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .number-types {
        grid-template-columns: 1fr;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

    .fact-cards {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tree Table Styles */
.tree-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--card-shadow);
}

.tree-table th {
    background: var(--header-gradient);
    color: white;
    padding: 1rem;
    font-weight: 600;
}

.tree-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--input-border);
    text-align: center;
    transition: background-color 0.3s ease;
}

.tree-table tr:last-child td {
    border-bottom: none;
}

.tree-table tr:nth-child(even) {
    background: #f8fafc;
}

.tree-table tr:hover td {
    background: #f1f5f9;
}

/* Menambahkan style untuk baris hasil */
.tree-table .result-row {
    background: #e8f5e9 !important;
    font-size: 1.1em;
    border-top: 2px solid #4caf50;
}

.tree-table .result-row td {
    padding: 1.2rem;
    color: #1b5e20;
}

.tree-table .result-row:hover td {
    background: #c8e6c9 !important;
}

/* Styles untuk visualisasi pohon konversi */
.conversion-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.conversion-section p {
    margin-bottom: 1rem;
}

.conversion-tree {
    margin: 1rem 0;
    overflow-x: auto;
}

.tree-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    box-shadow: 0 1px 4px var(--card-shadow);
}

.tree-table th,
.tree-table td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.tree-table th {
    background: #2c3e50;
    color: white;
    font-weight: bold;
}

.tree-table tr:nth-child(even) {
    background: #f5f6fa;
}

.tree-table tr:hover {
    background: #e8f4f8;
}

.conversion-section ul {
    margin-left: 1.5rem;
    list-style-type: disc;
}

.conversion-section strong {
    color: #2c3e50;
    font-weight: bold;
}

/* Style untuk penjelasan ramah anak */
.intro-explanation {
    background: linear-gradient(135deg, #FF9A8B, #FF6B95);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(255, 107, 149, 0.2);
}

.intro-explanation p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.kid-friendly-explanation {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 5px solid #6366f1;
}

.kid-friendly-explanation p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #4b5563;
}

.kid-friendly-explanation ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.kid-friendly-explanation ol li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.practical-example {
    background: #e8f5e9;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

.practical-example p {
    color: #1b5e20;
    margin-bottom: 1rem;
}

.practical-example ul {
    margin-left: 1.5rem;
}

.practical-example li {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

/* Animasi untuk emoji */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.conversion-section strong {
    display: inline-block;
}

.conversion-section strong:hover {
    animation: bounce 0.5s ease infinite;
}

/* Style untuk bagian konversi sebaliknya */
.reverse-conversion {
    background: #fff3e0;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 5px solid #ff9800;
}

.reverse-conversion p {
    margin-bottom: 1rem;
    color: #e65100;
}

.reverse-conversion ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.reverse-conversion li {
    color: #f57c00;
    margin-bottom: 0.5rem;
}

.reverse-conversion strong {
    color: #e65100;
}

.reverse-conversion .tree-table {
    margin-top: 1rem;
}

.reverse-conversion .tree-table th {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.reverse-conversion .tree-table td sup {
    font-size: 0.8em;
    position: relative;
    top: -0.5em;
}

/* Style untuk konversi langkah demi langkah */
.step-by-step-conversion {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.conversion-step {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.conversion-step h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.conversion-step p {
    color: #4b5563;
    margin-bottom: 0.8rem;
}

.matching-table {
    overflow-x: auto;
    margin: 1rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.matching-table table {
    width: 100%;
    border-collapse: collapse;
}

.matching-table th {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.matching-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 1.1rem;
}

.matching-table tr:nth-child(even) td {
    background: #f8fafc;
}

.matching-table td sup {
    font-size: 0.7em;
    position: relative;
    top: -0.5em;
    margin-left: 1px;
}

.calculation {
    font-size: 1.2rem;
    color: #2c3e50;
    padding: 1rem;
    background: #e2e8f0;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

.conversion-result {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.conversion-result h3 {
    font-size: 1.3rem;
    margin: 0;
}

.conversion-result sub {
    font-size: 0.7em;
    margin-left: 2px;
}

/* Style untuk catatan dan visualisasi posisi */
.note {
    background: #f0f9ff;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    color: #0369a1;
    font-size: 0.95rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid #0ea5e9;
}

.position-visualization {
    background: #f0fdf4;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.position-visualization .matching-table {
    margin: 0;
}

.position-visualization table {
    border: 2px solid #86efac;
}

.position-visualization th {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.position-visualization td {
    color: #166534;
}

.position-visualization tr:hover {
    background: #dcfce7;
}

/* Style untuk catatan contoh */
.example-note {
    background: #f0f9ff;
    padding: 1.2rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 4px solid #0ea5e9;
}

.example-note p {
    color: #0c4a6e;
    margin-bottom: 0.8rem;
}

.example-note strong {
    color: #0369a1;
}

.example-note ul {
    margin-left: 1.5rem;
    list-style-type: none;
}

.example-note li {
    color: #0c4a6e;
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.example-note li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #0ea5e9;
}

.example-note sub {
    font-size: 0.8em;
    vertical-align: sub;
}

/* Style untuk langkah-langkah perhitungan */
.calculation-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.calculation-steps li {
    background: #f8fafc;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: #4b5563;
    font-family: monospace;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.calculation-steps li:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.calculation-steps li:before {
    content: "→";
    margin-right: 1rem;
    color: #6366f1;
    font-weight: bold;
}

.creator-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.creator-info a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.creator-info a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Styling untuk Font Awesome icons */
.fa-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.2rem;
}

.fa-robot {
    color: #00ff9d;
    font-size: 1.2rem;
}

.fa-heart {
    color: #ff4d4d;
    animation: heartBeat 1.5s ease infinite;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.creator-link, .ai-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.creator-link:hover, .ai-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.creator-name, .ai-name {
    font-weight: 500;
}

/* Theme Variables */
:root[data-theme="light"] {
    --bg-color: #f0f2f5;
    --text-color: #1a1a1a;
    --card-bg: white;
    --card-shadow: rgba(0,0,0,0.1);
    --header-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --input-border: #e2e8f0;
    --input-bg: white;
    --badge-bg: rgba(255, 255, 255, 0.1);
    --secondary-text: #4b5563;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f2f5;
    --card-bg: #2d2d2d;
    --card-shadow: rgba(0,0,0,0.3);
    --header-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);
    --input-border: #4a4a4a;
    --input-bg: #3a3a3a;
    --badge-bg: rgba(0, 0, 0, 0.2);
    --secondary-text: #9ca3af;
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
}

.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-label {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.theme-ball {
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: transform 0.3s ease;
}

.fa-sun {
    color: #ffd700;
}

.fa-moon {
    color: #c8c8c8;
}

#theme-toggle {
    opacity: 0;
    position: absolute;
}

#theme-toggle:checked + .theme-label .theme-ball {
    transform: translateX(30px);
}

.theme-status {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Animation for theme switch */
@keyframes switchAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.theme-switch:active .theme-ball {
    animation: switchAnimation 0.3s ease;
}

/* Collapsible Section Styles */
.collapsible-section {
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 15px var(--card-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.section-header:hover {
    background: var(--header-gradient);
    color: white;
    border-radius: 12px;
    transform: translateY(-2px);
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.collapse-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-btn i {
    font-size: 1.2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content {
    background: var(--card-bg);
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-20px);
}

.section-content.show {
    max-height: fit-content;
    opacity: 1;
    transform: translateY(0);
    padding: 1.5rem;
}

.section-header.active {
    background: var(--header-gradient);
    color: white;
    border-radius: 12px 12px 0 0;
}

.section-header.active .collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(180deg);
}

.section-header.active .collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg) scale(1.1);
}

.section-header:not(.active):hover .collapse-btn {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* Animasi untuk konten saat dibuka */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.section-content > * {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content.show > * {
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Layout untuk layar besar */
@media (min-width: 1600px) {
    .container {
        max-width: 1800px;
        display: grid;
        grid-template-columns: minmax(350px, 25%) minmax(0, 75%);
        gap: 2rem;
        padding: 2rem 40px;
    }

    .main-content {
        grid-column: 2;
        max-width: 100%;
    }

    .side-content {
        grid-column: 1;
        position: sticky;
        top: 2rem;
        height: calc(100vh - 4rem);
        overflow-y: auto;
        padding-right: 1rem;
        /* Styling scrollbar */
        scrollbar-width: thin;
        scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
        order: -1; /* Memindahkan ke kiri */
    }

    .side-content::-webkit-scrollbar {
        width: 6px;
    }

    .side-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .side-content::-webkit-scrollbar-thumb {
        background-color: rgba(99, 102, 241, 0.5);
        border-radius: 20px;
    }

    .main-header {
        margin-bottom: 2rem;
        width: 100%;
    }

    .converter-box {
        margin-top: 0;
        width: 100%;
    }

    /* Animasi smooth untuk sticky sidebar */
    .side-content {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0 1rem;
        margin-right: 1rem;
        border-right: 2px solid var(--card-shadow);
    }

    .side-content:hover {
        transform: translateX(5px);
    }

    /* Mengatur ukuran maksimum konten samping */
    .collapsible-section {
        width: 100%;
        max-width: none;
    }

    /* Menyesuaikan padding dan margin untuk layout baru */
    .main-header,
    .intro-box,
    .converter-box,
    .explanation,
    .fun-facts {
        margin: 0 0 1.5rem 0;
    }

    /* Membuat shadow untuk memisahkan konten */
    .side-content {
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
        background: var(--bg-color);
        border-radius: 20px;
    }

    /* Menyesuaikan grid untuk hasil konversi */
    .results-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    /* Memperbesar area input utama */
    .main-input {
        padding: 2.5rem;
    }

    /* Menyesuaikan ukuran font untuk layar besar */
    .main-header h1 {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.4rem;
    }

    /* Animasi untuk konten yang muncul */
    .side-content .collapsible-section {
        animation: slideInFromLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

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

    .side-content .collapsible-section:nth-child(1) { animation-delay: 0.1s; }
    .side-content .collapsible-section:nth-child(2) { animation-delay: 0.2s; }
    .side-content .collapsible-section:nth-child(3) { animation-delay: 0.3s; }
}

/* Animasi untuk transisi layout */
@media (min-width: 1600px) {
    .container > * {
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .side-content .collapsible-section {
        opacity: 0;
        transform: translateX(20px);
        animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .side-content .collapsible-section:nth-child(1) { animation-delay: 0.1s; }
    .side-content .collapsible-section:nth-child(2) { animation-delay: 0.2s; }
    .side-content .collapsible-section:nth-child(3) { animation-delay: 0.3s; }
}

/* Mobile Styles */
@media (max-width: 480px) {
    body {
        padding: 0.5rem 0;
    }

    .container {
        padding: 0 10px;
    }

    /* Header yang lebih ringkas untuk mobile */
    .main-header {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .header-title {
        margin-bottom: 1rem;
    }

    .title-animation {
        gap: 0.5rem;
    }

    .title-animation h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .emoji-left, .emoji-right {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Badges yang lebih kecil dan stack vertikal */
    .header-badges {
        flex-direction: column;
        gap: 0.5rem;
        margin: 1rem 0;
    }

    .badge {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
    }

    .badge-text {
        font-size: 0.8rem;
    }

    /* Creator info yang lebih compact */
    .creator-info {
        margin-top: 1rem;
        padding-top: 0.5rem;
    }

    .creator-info p {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .creator-link, .ai-link {
        width: 100%;
        justify-content: center;
        padding: 0.4rem;
    }

    /* Theme switch yang lebih kecil */
    .theme-switch-wrapper {
        top: 0.5rem;
        right: 0.5rem;
    }

    .theme-switch {
        width: 50px;
        height: 25px;
    }

    .theme-ball {
        width: 20px;
        height: 20px;
    }

    .theme-status {
        display: none;
    }

    /* Konverter yang lebih adaptif */
    .converter-box {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .main-input {
        padding: 1rem;
    }

    input {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .input-hint {
        font-size: 0.8rem;
    }

    /* Hasil konversi yang lebih compact */
    .results-container {
        gap: 1rem;
    }

    .result-group {
        padding: 1rem;
    }

    .result-label {
        font-size: 0.9rem;
    }

    .icon {
        font-size: 1.2rem;
    }

    /* Visualisasi yang lebih kecil */
    .bit {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    /* Collapsible sections yang lebih compact */
    .collapsible-section {
        margin-bottom: 1rem;
    }

    .section-header {
        padding: 1rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .section-content.show {
        padding: 1rem;
    }

    /* Tab yang lebih kecil dan scrollable */
    .explanation-tabs {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Fact cards yang lebih compact */
    .fact-cards {
        gap: 1rem;
    }

    .fact-card {
        padding: 1rem;
    }

    .fact-card h3 {
        font-size: 1rem;
    }

    .fact-card p {
        font-size: 0.9rem;
    }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .main-header {
        padding: 1.5rem;
    }

    .title-animation h1 {
        font-size: 2rem;
    }

    .header-badges {
        flex-wrap: wrap;
        justify-content: center;
    }

    .badge {
        flex: 0 1 calc(50% - 1rem);
    }
}

/* Landscape Mode Fixes */
@media (max-height: 480px) and (orientation: landscape) {
    .main-header {
        padding: 1rem;
    }

    .header-badges {
        display: none;
    }

    .side-content {
        max-height: 80vh;
    }
}
