:root {
    --primary-color: #f6e65a;
    --secondary-color: #4a4a4a;
    --background-color: #2c3e50;
    --app-background: #eee;
    --polaroid-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    --button-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--secondary-color);
    line-height: 1.6;
}

.app-container {
    max-width: 900px;
    width: 95%;
    min-height: 90vh;
    background: var(--app-background);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    padding: 2vh 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-header h1 {
    font-size: 2.5em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.app-header p {
    font-size: 1em;
    color: #7f8c8d;
    margin: 0 0 20px 0;
}

.upload-button, .download-button {
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: var(--button-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-button {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.upload-button:hover {
    background-color: #f8e874;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.hidden-input {
    display: none;
}

.preview-area {
    margin: 20px 0;
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    gap: 30px;
    overflow-y: auto;
}

.polaroid-frame {
    /* Medidas para 10cm x 12cm */
    width: 28.3vh;
    height: 34vh;
    background-color: transparent;
    box-shadow: var(--polaroid-shadow);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
    box-sizing: content-box;
    cursor: grab;
    overflow: hidden;
    padding: 0;
}

.polaroid-frame.black {
    background-color: #000;
}

.polaroid-frame:hover {
    transform: scale(1.03);
}

.polaroid-frame.active {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.image-container {
    /* Medidas para 9cm x 9cm */
    width: 25.4vh;
    height: 25.4vh;
    position: relative;
    overflow: hidden;
    background-color: transparent;
    margin: 2.8vh 1.4vh 5.6vh 1.4vh; /* 1cm arriba, 0.5cm lados, 2cm abajo */
}

.draggable-image {
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    user-select: none;
    transform-origin: 50% 50%;
}

.controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.options-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.color-control, .zoom-control {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#color-selector, #zoom-slider {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: 'Poppins', sans-serif;
    margin-top: 5px;
}

#zoom-slider {
    padding: 0;
    width: 150px;
    -webkit-appearance: none;
    height: 8px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

#zoom-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.action-buttons {
    margin-top: 10px;
}

.download-button {
    background-color: #28a745;
    color: #fff;
}

.download-button:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.download-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 600px) {
    .app-container {
        padding: 20px;
    }
    .app-header h1 {
        font-size: 2em;
    }
    .app-header p {
        font-size: 0.9em;
    }
    .polaroid-frame {
        width: 28.3vh;
        height: 34vh;
    }
    .image-container {
        width: 25.4vh;
        height: 25.4vh;
    }
    .zoom-control {
        display: none;
    }
}