* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1A2980, #26D0CE);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

main {
    background-color: white;
    padding: 40px 40px 20px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 90%;
    max-width: 600px;
    margin-top: 20px;
}

footer {
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

footer p {
    margin: 10px 0;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 0.9em;
}

footer a {
    color: #FFD700;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-logo img {
    width: 50px;
    height: auto;
}

h1 {
    font-family: 'Ubuntu Sans', sans-serif;
    font-size: 4em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
}

h2 {
    font-family: 'Ubuntu Sans', sans-serif;
    font-size: 1.7em;
    color: #555;
    margin-top: 10px;
    margin-bottom: 50px;
}

.controls {
    margin-bottom: 35px;
    position: relative;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-group label {
    font-size: 0.9em;
    color: #555;
    margin-right: 10px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.control-group input[type="range"] {
    appearance: none;
    width: calc(100% - 150px);
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007BFF;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.control-group input[type="range"]:hover::-webkit-slider-thumb {
    background: #0056b3;
    transform: scale(1.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 5px;
}

.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;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007BFF;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

#uploadArea {
    position: relative;
    margin-top: 10px;
    margin-bottom: 10px;
}

#dropZone {
    display: block;
    width: 100%;
    padding: 50px;
    border: 2px dashed #007BFF;
    border-radius: 16px;
    cursor: pointer;
    color: #007BFF;
    background-color: #f7faff;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

#dropZone.hover, #dropZone:hover {
    background-color: #e3f2fd;
    border-color: #0056b3;
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.2);
}

.download-btn {
    display: inline-block;
    margin-top: 20px;
    text-decoration: none;
    background-color: #007BFF;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1em;
    transition: background-color 0.3s, transform 0.3s;
}

.download-btn:hover {
    background-color: #0056b3;
}

.output-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

#resultImage {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 30px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#resultImage:hover {
    transform: scale(1.02);
    border-color: #bbb;
}

.spinner {
    position: absolute;
    top:calc(50% - 35px);
    left:calc(50% - 35px);
    z-index: 10;
    border: 8px solid rgba(0, 123, 255, 0.2);
    border-top: 8px solid #007BFF;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ffffff;
    font-size: 35px;
    font-weight: bold;
    transition: color 0.3s;
    display: none;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    main {
        width: 100%;
        margin-top: 10px;
        padding: 20px;
    }

    .modal-content {
        width: 95%;
    }
}
