* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    opacity: 0.8;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feature-card h2 {
    margin-bottom: 10px;
    color: #667eea;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 20px;
}

.info {
    text-align: center;
    color: #666;
    margin-top: 30px;
}

.info p {
    margin: 5px 0;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
}

footer a {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
}

footer a:hover {
    text-decoration: underline;
}

/* Upload Area */
.upload-area {
    margin-bottom: 30px;
}

.file-upload {
    position: relative;
    margin-bottom: 20px;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-label {
    display: block;
    padding: 60px 20px;
    border: 3px dashed #667eea;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-label:hover {
    background: #f5f5ff;
}

.upload-label.drag-over {
    background: #e8ebff;
    border-color: #764ba2;
}

.upload-label span {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 600;
}

.file-info, .file-list {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-item {
    background: white;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
    cursor: move;
}

.file-item.dragging {
    opacity: 0.5;
}

.file-item-name {
    font-weight: 500;
}

.file-item-remove {
    color: #d32f2f;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.file-item-remove:hover {
    background: #ffebee;
}

/* Options */
.options {
    margin: 20px 0;
}

.options h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.option {
    margin: 12px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.option input[type="radio"] {
    margin-right: 10px;
}

.option label {
    cursor: pointer;
    display: inline-block;
}

.option input[type="text"] {
    margin-left: 30px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: calc(100% - 40px);
    display: block;
}

.option input[type="text"]:disabled {
    background: #f0f0f0;
    color: #999;
}

/* Progress */
.progress {
    margin: 30px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    color: #667eea;
    font-weight: 600;
}

/* Result */
.result {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.result.error {
    background: #ffebee;
    border-color: #d32f2f;
}

.result h3 {
    margin-bottom: 15px;
    color: #4caf50;
}

.result.error h3 {
    color: #d32f2f;
}

.download-link {
    display: inline-block;
    margin: 10px 5px;
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.download-link:hover {
    background: #45a049;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

/* Image Preview */
.image-preview {
    margin: 20px 0;
    text-align: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.image-preview h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-types {
    display: block;
    font-size: 0.9em;
    margin-top: 5px;
    color: #999;
}

.option-hint {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.option select,
.option input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

.option input[type="range"] {
    width: 100%;
    margin-top: 10px;
}

#resizeOptions label {
    display: inline-block;
}

#resizeOptions input[type="number"] {
    width: 150px;
    margin-left: 5px;
}
