.custom-control-input:focus~.custom-control-label::before {
    box-shadow: none !important;
    border-color: #adb5bd !important;
}

.custom-control-input:checked~.custom-control-label::before {
    border-color: #adb5bd !important;
    background-color: #adb5bd !important;
}

.custom-control-input:focus:not(:checked)~.custom-control-label::before {
    border-color: #adb5bd !important;
}

.beforeafterText {
    font-size: 15px;
    color: gray;
    padding-top: 7px;
    margin: 0;
}

.container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 20px;
    }

    .upload-container, .controls-section {
        width: 100%;
        max-width: 300px;
    }
}

/* 左侧上传区域 */
.upload-section {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    height: 280px;
    background: white;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

/* 右侧控制区域 */
.controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    height: 340px;
    padding: 10px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.6);
    width: 220px;
}

.controls-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.controls-row-before_after {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    width: 100%;
    justify-content: space-between;
}

.controls-row button {
    width: 100%;
    max-width: none;
}

.joystick {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    gap: 10px;
    justify-items: center;
    align-items: center;
    margin-top: 20px;
}

.joystick button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    font-size: 16px;
    border: 2px solid #6c757d;
    color: #6c757d;
    background: #ffffff;
    transition: all 0.3s;
}

.joystick button:active {
    background: #6c757d;
    color: white;
}

.joystick .center-button {
    background-color: #00d2ff;
    color: white;
    border: none;
}

/* 自定义按钮样式 */
.btn-outline-custom {
    color: #acb0b4;
    border: 1.5px solid #adb5bd;
    background-color: white;
    border-radius: 12px;
    padding: 2px 2px;
    transition: all 0.3s;
}

.btn-outline-custom:not(:disabled):hover {
    background-color: #adb5bd;
    color: white;
}

.btn-outline-custom.active {
    background-color: #6c757d;
    color: white;
}

.btn-outline-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #acb0b4;
    border-color: #dee2e6;
}

.upload-section a {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
}

.joystick button,
.btn-outline-custom {
    outline: none;
}

.joystick button:focus,
.btn-outline-custom:focus {
    outline: none;
    box-shadow: none;
}

.grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.loading-container {
    position: relative;
    display: inline-block;
}

.loading-text {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 1000;
    animation: loadingColorChange 1s infinite;
}

@keyframes loadingColorChange {
    0% {
        color: white;
    }
    50% {
        color: #72d6fe;
    }
    100% {
        color: white;
    }
}

.loading .loading-text {
    display: block;
}

.custom-control-input:disabled~.custom-control-label {
    cursor: not-allowed;
}

.custom-control-input:disabled~.custom-control-label::before {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Upload button styles */
.upload-container {
    text-align: center;
    border: 2px dashed #d3d3d3;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.3s ease;
}

.upload-container:hover {
    border-color: #72d6fe;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.8);
}

.upload-button {
    background: linear-gradient(to right, #72d6fe, #a4e8d1);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background 0.3s ease;
}

.upload-button:hover {
    background: linear-gradient(to right, #a4e8d1, #72d6fe);
}

.upload-container p {
    margin: 0;
    color: #a3a3a3;
}

/* Control button styles */
.button-13 {
    background-color: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    box-shadow: rgba(213, 217, 217, .5) 0 2px 5px 0;
    box-sizing: border-box;
    color: #0f1111;
    cursor: pointer;
    display: inline-block;
    font-family: "Amazon Ember", sans-serif;
    font-size: 13px;
    line-height: 29px;
    padding: 0 10px 0 11px;
    position: relative;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    vertical-align: middle;
    width: 100px;
}

.button-13:hover {
    background-color: #f7fafa;
}

.button-13:focus {
    border-color: #008296;
    box-shadow: rgba(213, 217, 217, .5) 0 2px 5px 0;
    outline: 0;
}

/* Example image styles */
.no-image-container {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.no-image-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle2 {
    font-size: 15px;
    color: #666;
    margin-bottom: 0px;
    text-align: center;
}

.example-images {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.image-card {
    width: 80px;
    height: auto;
    overflow: hidden;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-8px);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.terms {
    color: #666;
    font-size: 14px;
    text-align: center;
}

.example-image-input {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.demo-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Modal styles */
.demo-image-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 455px;
    display: none;
}

@media (max-width: 768px) {
    .demo-image-modal {
        width: 85%;
        max-width: 350px;
        padding: 15px;
    }

    .demo-image-modal .close-button {
        font-size: 18px !important;
        padding: 12px 8px;
        margin-top: 20px;
    }

    .demo-image-modal label[for="dontShowAgain"] {
        font-size: 16px !important;
    }

    .demo-image-modal hr {
        margin: 15px 0;
    }

    .close-modal {
        top: 2px;
        right: 2px;
        font-size: 32px;
        padding: 5px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.close-modal {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    font-weight: bold;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-modal:hover {
    color: #333;
}

.close-button {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 8px;
    border-radius: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.close-button:hover {
    background-color: #218838;
}