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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1820px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h2, h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #4CAF50;
    border-radius: 8px;
    padding: clamp(20px, 5vw, 40px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background-color: #f9f9f9;
}

.upload-area:hover {
    background-color: #f0f0f0;
    border-color: #45a049;
}

.upload-area i {
    font-size: clamp(2rem, 8vw, 3rem);
    color: #4CAF50;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 10px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

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

.files-list {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 0;
}

.files-list h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

#files-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.file-item {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    height: 100%;
}

.file-item .file-preview {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item .file-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-item .file-name {
    font-weight: bold;
    word-break: break-all;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.file-item .file-info {
    font-size: 0.8em;
    color: #666;
}

.file-item .file-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.file-item button {
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: auto;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
    margin-top: auto;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

button {
    padding: 15px 30px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(1rem, 2vw, 1.2rem);
    transition: all 0.3s ease;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button i {
    font-size: 1.2em;
}

#clearAll {
    background-color: #f44336;
}

#clearAll:hover {
    background-color: #d32f2f;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dimensions-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.info-group {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-group h3 {
    color: #333;
    margin-bottom: 0;
    font-size: 1.2rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.file-input, .dimensions-input, .new-dimensions-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dimensions-input, .new-dimensions-input {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.dimensions-input > div, .new-dimensions-input > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: bold;
    color: #555;
    font-size: 0.95rem;
}

input[type="file"],
input[type="number"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

input[type="number"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    height: 30px;
    opacity: 1;
    margin-right: 5px;
}

.file-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.preview-btn {
    background-color: #4CAF50;
    color: white;
}

.resize-btn {
    background-color: #2196F3;
    color: white;
}

.download-btn {
    background-color: #FF9800;
    color: white;
}

.remove-btn {
    background-color: #f44336;
    color: white;
}

.file-actions button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.file-actions button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.file-actions button i {
    font-size: 14px;
}

/* Media Queries */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .dimensions-info {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .info-group {
        padding: 15px;
    }

    input[type="number"] {
        padding: 10px;
    }

    .buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    button {
        width: 100%;
    }

    .file-item .file-actions {
        flex-direction: column;
    }

    .file-item button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 15px;
    }

    .file-item {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .buttons {
        padding: 15px;
    }

    .dimensions-info {
        padding: 10px;
    }

    .info-group {
        padding: 12px;
    }

    input[type="number"] {
        padding: 8px;
    }
} 