/*
 * style.css: Custom styles for the Image Resizer tool
 *
 * This version provides a clean, minimal, and modern aesthetic.
 * It uses a simplified color palette, subtle shadows, and a focus on
 * typography to create a professional and user-friendly interface.
 */

/* --- Custom Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- General Layout & Elements --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa; /* Very light gray background */
    color: #343a40; /* Dark gray for main text */
}

/* Container for the main content */
.main-container {
    max-width: 900px; /* Slightly smaller for a tighter feel */
    margin: 3rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); /* Softer shadow */
}

/* Main headings */
h1, h2 {
    color: #212529; /* Deep black-like color for headings */
    font-weight: 600;
}

/* Main description text */
.main-description {
    font-size: 1rem;
    line-height: 1.5;
    color: #6c757d;
}

/* --- Drop Area --- */
.drop-area.highlight {
    border-color: #007bff;
    background-color: #e9f5ff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.1);
}

/* --- Input Fields & Buttons --- */
.input-field {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.action-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Hide the number input arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- File Preview Grid --- */
.file-preview-grid, .results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out;
}

.preview-item:hover {
    transform: translateY(-2px);
}

.preview-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.preview-info {
    padding: 8px;
    background-color: #f1f3f5;
    text-align: center;
}

.preview-filename {
    font-size: 0.875rem;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.remove-button, .download-button {
    position: absolute;
    top: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.remove-button {
    right: 4px;
}

.download-button {
    left: 4px;
}

.preview-item:hover .remove-button,
.preview-item:hover .download-button {
    opacity: 1;
}

.remove-button svg {
    color: #ef4444;
}

.download-button svg {
    color: #2563eb;
}

/* --- Loading Indicator --- */
.loading-indicator {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, .1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Message Box --- */
.message-modal {
    transition: opacity 0.3s ease-in-out;
}

.message-box {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
