.convolution-container {
    max-width: 1000px;
    padding: 18px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* .container-konvolusi {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
} */

.container-konvolusi {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 5px;
    max-width: 1200px;
    font-family: 'Segoe UI', sans-serif;
    padding: 15px 5px;
    background-color: #fefcf8;
    color: #3e2c23;
}

.title {
    margin-bottom: 20px;
    font-size: 40px;
    color: #72391d;
}

.section {
    flex: 1;
    text-align: center;
}

.middle {
    flex: 0.8;
    background-color: #fdf6ee;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.matrix {
    display: grid;
    grid-template-columns: repeat(6, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.matrix-4 {
    display: grid;
    grid-template-columns: repeat(4, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.matrix-3 {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.small {
    grid-template-columns: repeat(3, 40px) !important;
}

.small-2x2 {
    grid-template-columns: repeat(2, 40px) !important;
}

.small-5x5 {
    grid-template-columns: repeat(5, 40px) !important;
}

.output {
    grid-template-columns: repeat(6, 40px);
}

.output-4 {
    grid-template-columns: repeat(4, 40px);
}

.output-3 {
    grid-template-columns: repeat(3, 40px);
}

.matrix-padding {
    display: grid;
    grid-template-columns: repeat(6, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.matrix-padding-2x2 {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.matrix-5x5 {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

/* .output-padding {
    grid-template-columns: repeat(4, 40px);
} */

.output-5x5 {
    grid-template-columns: repeat(3, 40px);
}

.output-padding {
    grid-template-columns: repeat(8, 40px);
}

.cell.padding {
    background-color: #e1e1e1;
    /* warna untuk padding */
}

.cell {
    width: 35px;
    height: 35px;
    border: 1px solid #a8a5a5;
    text-align: center;
    line-height: 40px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    background-color: #fffef9;
    border-radius: 6px;
}

#source .cell {
    background-color: #f3e9db;
}

#kernel .cell {
    background-color: #f9eedc;
}

#output .cell {
    background-color: #e7eced;
}

.highlight {
    border: 2px solid #e63946;
}

.output-highlight {
    border: 2px solid #e63946;
    box-shadow: 0 0 4px red;
}

.highlight-animate {
    animation: flashOrange 0.4s ease-in-out;
    background-color: #fdba74 !important;
}

@keyframes flashOrange {
    0% {
        background-color: #fff7ed;
    }

    50% {
        background-color: #fdba74;
    }

    100% {
        background-color: #f3e9db;
    }
}

#calculation {
    background-color: #f8f4ef;
    padding: 16px 20px;
    border-left: 5px solid #b08968;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
}

#calculation p {
    margin: 0;
}

.calculation-wrapper {
    text-align: center;
    margin-top: 10px;
}

.calculation-title {
    font-size: 18px;
    color: #5a4636;
    margin-bottom: 2px;
}

.calculation-box {
    display: inline-block;
    background-color: #f8f4ef;
    padding: 16px 20px;
    border-left: 5px solid #b08968;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    text-align: left;
    min-width: 280px;
    max-width: 100%;
}

.calculation-placeholder {
    color: black;
    margin: 0;
}


#button-container {
    margin-top: 20px;
}

.buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.kernel-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-next-step {
    background-color: #976148;
    color: white;
    padding: 6px 20px;
    font-size: 13px;
    border: none;
    border-radius: 10px;
    margin: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-next-step-gaussian {
    background-color: #976148;
    color: white;
    padding: 6px 20px;
    font-size: 13px;
    border: none;
    border-radius: 10px;
    margin: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-next:hover {
    background-color: #654733 !important;
    transform: scale(1.05) !important;
}

.btn-reset {
    background-color: #ce8338;
    color: white;
    padding: 6px 20px;
    font-size: 13px;
    border: none;
    border-radius: 10px;
    margin: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-reset-gaussian {
    background-color: #ce8338;
    color: white;
    padding: 6px 20px;
    font-size: 13px;
    border: none;
    border-radius: 10px;
    margin: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: #a26b28 !important;
    transform: scale(1.05) !important;
}

.btn-reset-gaussian:hover {
    background-color: #a26b28 !important;
    transform: scale(1.05) !important;
}

.btn-reset {
    display: none;
    /* awalnya disembunyikan */
}

select {
    margin: 8px 0;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

input {
    width: 38px;
    height: 38px;
    text-align: center;
    font-size: 16px;
    border: none;
    background-color: #fffbe0;
}

.kernel-select-container {
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#kernel {
    font-size: 14px;
    padding: 0px 10px;
    width: auto;
    border-radius: 6px;
}

.label-kernel {
    font-size: 14px;
    margin-bottom: 4px;
    text-align: center;
}

/* Tombol lebih kecil */
.btn-next-step,
.btn-reset {
    font-size: 15px !important;
    padding: 8px 18px !important;
    margin: 6px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kernel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    /* jarak antara label dan select */
    justify-content: center;
    margin-bottom: 16px;
}

.kernel-header label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

#kernelSelect {
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 120px;
}

#paddingToggle {
    margin-right: 6px;
}

.kalku-padding {
    text-align: center;
}
/* Desktop kecil (<= 1024px) */
@media (max-width: 1024px) {
    .container-konvolusi {
        transform: scale(0.9);
        transform-origin: top center;
        margin: 0 auto -40px auto; /* Tambah margin bottom negatif */
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .container-konvolusi > .section {
        flex-shrink: 0;
    }

    .calculation-wrapper {
        margin-top: -30px !important;
    }
}

/* Tablet landscape (<= 768px) */
@media (max-width: 768px) {
    .container-konvolusi {
        transform: scale(0.8);
        transform-origin: top center;
        margin: 0 auto -60px auto;
    }

    .calculation-wrapper {
        margin-top: -40px !important;
    }
}

/* Tablet portrait / smartphone besar (<= 600px) */
@media (max-width: 600px) {
    .container-konvolusi {
        transform: scale(0.65);
        transform-origin: top center;
        margin: 0 auto -100px auto; /* lebih negatif */
    }

    .calculation-wrapper {
        margin-top: -70px !important;
    }
}

/* Smartphone sedang (<= 480px) */
@media (max-width: 480px) {
    .container-konvolusi {
        transform: scale(0.53);
        transform-origin: top center;
        margin: 0 auto -135px auto;
    }

    .calculation-wrapper {
        margin-top: -90px !important;
    }
}

/* Smartphone kecil / very small devices (<= 360px) */
@media (max-width: 360px) {
    .container-konvolusi {
        transform: scale(0.45);
        transform-origin: top center;
        margin: 0 auto -165px auto;
    }

    .calculation-wrapper {
        margin-top: -120px !important;
    }
}


