* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #2d3e56 100%);
    color: #e1e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: rgba(15, 20, 25, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 150, 200, 0.2);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #64b5f6, #42a5f5, #2196f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(100, 181, 246, 0.3);
}

header p {
    font-size: 1.2em;
    color: #b0c4de;
    opacity: 0.9;
}

.message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.5s ease-out;
}

.message.success {
    background: linear-gradient(45deg, rgba(76, 175, 80, 0.2), rgba(139, 195, 74, 0.2));
    border: 1px solid #4caf50;
    color: #81c784;
}

.message.error {
    background: linear-gradient(45deg, rgba(244, 67, 54, 0.2), rgba(229, 115, 115, 0.2));
    border: 1px solid #f44336;
    color: #ef5350;
}

.upload-form {
    background: rgba(15, 20, 25, 0.4);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(100, 150, 200, 0.15);
    margin-bottom: 30px;
}

.upload-section {
    margin-bottom: 30px;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(45deg, rgba(33, 150, 243, 0.1), rgba(63, 81, 181, 0.1));
    border: 2px dashed #42a5f5;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.file-label:hover {
    background: linear-gradient(45deg, rgba(33, 150, 243, 0.2), rgba(63, 81, 181, 0.2));
    border-color: #64b5f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 181, 246, 0.2);
}

.file-icon {
    font-size: 3em;
    margin-right: 15px;
}

.file-text {
    font-size: 1.3em;
    font-weight: 500;
    color: #64b5f6;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.setting-group {
    background: rgba(30, 40, 50, 0.6);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    transition: all 0.3s ease;
}

.setting-group h3 {
    margin-bottom: 15px;
    color: #90caf9;
    font-size: 1.1em;
}

.select-field {
    width: 100%;
    padding: 12px 15px;
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 10px;
    color: #e1e8f0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-field:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.2);
}

.range-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 5px;
    background: rgba(100, 150, 200, 0.3);
    outline: none;
    margin-bottom: 10px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(66, 165, 245, 0.4);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(66, 165, 245, 0.4);
}

.range-value {
    display: inline-block;
    background: rgba(66, 165, 245, 0.2);
    color: #64b5f6;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Estilos para seção de fundo */
.background-section {
    background: rgba(30, 40, 50, 0.4);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    margin-bottom: 30px;
}

.background-section h3 {
    margin-bottom: 20px;
    color: #90caf9;
    font-size: 1.3em;
    text-align: center;
}

.bg-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bg-option {
    background: rgba(15, 20, 25, 0.6);
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    transition: all 0.3s ease;
}

.bg-type-section h4 {
    color: #b0c4de;
    margin-bottom: 15px;
    font-size: 1em;
}

.bg-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #e1e8f0;
    position: relative;
    padding-left: 35px;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(15, 20, 25, 0.8);
    border: 2px solid rgba(100, 150, 200, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    border-color: #42a5f5;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #42a5f5;
    border-color: #42a5f5;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

/* Radio buttons personalizados */
.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #e1e8f0;
    position: relative;
    padding: 10px 15px;
    background: rgba(15, 20, 25, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    transition: all 0.3s ease;
}

.radio-option:hover {
    background: rgba(15, 20, 25, 0.8);
    border-color: #42a5f5;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-mark {
    height: 18px;
    width: 18px;
    background-color: rgba(15, 20, 25, 0.8);
    border: 2px solid rgba(100, 150, 200, 0.3);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.radio-option:hover .radio-mark {
    border-color: #42a5f5;
}

.radio-option input:checked ~ .radio-mark {
    background-color: #42a5f5;
    border-color: #42a5f5;
}

.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-option input:checked ~ .radio-mark:after {
    display: block;
}

/* Seletor de cor */
.color-picker-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(15, 20, 25, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(100, 150, 200, 0.1);
}

.color-picker-section label {
    display: block;
    margin-bottom: 10px;
    color: #b0c4de;
    font-weight: 500;
}

.color-picker {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.2);
}

.dimensions-section {
    background: rgba(30, 40, 50, 0.4);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    margin-bottom: 30px;
}

.dimensions-section h3 {
    margin-bottom: 20px;
    color: #90caf9;
    font-size: 1.3em;
    text-align: center;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dimension-group {
    background: rgba(15, 20, 25, 0.6);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    transition: all 0.3s ease;
}

.dimension-group h4 {
    margin-bottom: 15px;
    color: #b0c4de;
    font-size: 1em;
    text-align: center;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dimension-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 10px;
    color: #e1e8f0;
    font-size: 16px;
    transition: all 0.3s ease;
}

.dimension-input.full-width {
    width: 100%;
}

.dimension-input:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.2);
}

.dimension-input::placeholder {
    color: rgba(225, 232, 240, 0.5);
}

.separator {
    color: #90caf9;
    font-weight: bold;
    font-size: 1.2em;
}

.convert-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(45deg, #42a5f5, #2196f3, #1976d2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(66, 165, 245, 0.3);
    position: relative;
    overflow: hidden;
}

.convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(66, 165, 245, 0.4);
    background: linear-gradient(45deg, #1976d2, #1565c0, #0d47a1);
}

.convert-btn:active {
    transform: translateY(-1px);
}

.result {
    background: rgba(15, 20, 25, 0.6);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 150, 200, 0.2);
    margin-bottom: 30px;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

.result h3 {
    margin-bottom: 20px;
    color: #90caf9;
    font-size: 1.4em;
}

.converted-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.download-section {
    margin-top: 20px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #4caf50, #388e3c);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    background: linear-gradient(45deg, #388e3c, #2e7d32);
}

.info-section {
    background: rgba(15, 20, 25, 0.4);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    text-align: center;
}

.info-section h3 {
    margin-bottom: 20px;
    color: #90caf9;
    font-size: 1.2em;
}

.formats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.format-tag {
    background: linear-gradient(45deg, rgba(63, 81, 181, 0.2), rgba(33, 150, 243, 0.2));
    color: #90caf9;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid rgba(100, 150, 200, 0.2);
    transition: all 0.3s ease;
}

.format-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.2);
}

.ico-tag {
    background: linear-gradient(45deg, rgba(255, 152, 0, 0.2), rgba(255, 193, 7, 0.2));
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.ico-tag:hover {
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.2);
}

.format-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(15, 20, 25, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    text-align: left;
}

.format-info p {
    margin-bottom: 15px;
    color: #b0c4de;
    font-size: 0.95em;
    line-height: 1.6;
}

.format-info p:last-child {
    margin-bottom: 0;
}

.format-info strong {
    color: #90caf9;
}

/* Estilos para preview da imagem */
.image-preview {
    background: rgba(15, 20, 25, 0.6);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border: 1px solid rgba(100, 150, 200, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.preview-container h4 {
    color: #90caf9;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2em;
}

.preview-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.original-preview, .processed-preview {
    text-align: center;
}

.original-preview h5, .processed-preview h5 {
    color: #b0c4de;
    margin-bottom: 10px;
    font-size: 1em;
}

.preview-image {
    max-width: 100%;
    max-height: 250px;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(100, 150, 200, 0.1);
}

#preview-canvas {
    background: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.image-info {
    background: rgba(30, 40, 50, 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(100, 150, 200, 0.1);
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.info-label {
    font-size: 0.85em;
    color: #b0c4de;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #64b5f6;
    font-size: 1em;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.preview-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, rgba(156, 39, 176, 0.2), rgba(123, 31, 162, 0.2));
    color: #ce93d8;
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.preview-btn:hover {
    background: linear-gradient(45deg, rgba(156, 39, 176, 0.3), rgba(123, 31, 162, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.2);
}

/* Estilos para validação */
.dimension-input.error {
    border-color: #f44336 !important;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2) !important;
}

.input-error {
    color: #ef5350;
    font-size: 0.85em;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(244, 67, 54, 0.2);
    animation: slideIn 0.3s ease-out;
}

/* Botão limpar campos */
.clear-btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 25px;
    background: linear-gradient(45deg, rgba(255, 152, 0, 0.2), rgba(255, 193, 7, 0.2));
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.clear-btn:hover {
    background: linear-gradient(45deg, rgba(255, 152, 0, 0.3), rgba(255, 193, 7, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.2);
}

/* Efeito ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animação de pulsação */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: linear-gradient(45deg, rgba(244, 67, 54, 0.9), rgba(229, 115, 115, 0.9));
    border: 1px solid #f44336;
    color: white;
}

.notification.success {
    background: linear-gradient(45deg, rgba(76, 175, 80, 0.9), rgba(139, 195, 74, 0.9));
    border: 1px solid #4caf50;
    color: white;
}

.notification.info {
    background: linear-gradient(45deg, rgba(33, 150, 243, 0.9), rgba(100, 181, 246, 0.9));
    border: 1px solid #2196f3;
    color: white;
}

.notification-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.notification-text {
    font-weight: 500;
    line-height: 1.4;
}

/* Animações de hover para cards */
.setting-group, .dimension-group, .bg-option {
    position: relative;
    overflow: hidden;
}

.setting-group::before, .dimension-group::before, .bg-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 181, 246, 0.1), transparent);
    transition: left 0.5s;
}

.setting-group:hover::before, .dimension-group:hover::before, .bg-option:hover::before {
    left: 100%;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
    
    .bg-type-grid {
        grid-template-columns: 1fr;
    }
    
    .formats {
        gap: 10px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .separator {
        display: none;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preview-images {
        grid-template-columns: 1fr;
    }
    
    .preview-controls {
        flex-direction: column;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        max-width: none;
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .upload-form {
        padding: 20px;
    }
    
    .file-label {
        padding: 30px 15px;
        min-height: 100px;
    }
    
    .file-icon {
        font-size: 2.5em;
    }
    
    .file-text {
        font-size: 1.1em;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}