/* ========================================
   Asset Bundler Pro - Main Stylesheet
   ======================================== */

/* ----------------------------
   Base Styles
   ---------------------------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #F4F4F2 0%, #E8E8E8 100%);
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

@media (min-width: 640px) {
    body {
        padding: 2rem;
    }
}

/* Background gradient class */
.bg-gradient {
    background: linear-gradient(135deg, #F4F4F2 0%, #E8E8E8 100%);
}

/* ----------------------------
   Typography
   ---------------------------- */
.site-header {
    color: #495464;
    letter-spacing: -0.5px;
    font-size: 2.4rem !important; /* 40px on mobile */
    line-height: 1.2;
}

@media (min-width: 768px) {
    .site-header {
        font-size: 3rem; /* 48px on medium screens */
    }
}

@media (min-width: 1024px) {
    .site-header {
        font-size: 3.5rem; /* 56px on large screens */
    }
}

.site-description {
    color: #495464;
    opacity: 0.8;
    font-size: 1.125rem; /* 18px */
}

@media (min-width: 768px) {
    .site-description {
        font-size: 1.25rem; /* 20px on medium screens */
    }
}

.section-header {
    color: #495464;
    font-size: 1.875rem; /* 30px */
}

@media (min-width: 768px) {
    .section-header {
        font-size: 2.25rem; /* 36px on medium screens */
    }
}

.input-label {
    color: #495464;
}

.input-hint {
    color: #BBBFCA;
}

.loading-text {
    color: #495464;
}

.selection-count {
    color: #BBBFCA;
}

.site-footer {
    color: #BBBFCA;
}

/* ----------------------------
   Animations
   ---------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* ----------------------------
   Utility Classes
   ---------------------------- */
.hidden {
    display: none !important;
}

/* ----------------------------
   Form Elements
   ---------------------------- */
.form-input {
    border-color: #E8E8E8;
    background-color: #F4F4F2;
    color: #495464;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(73, 84, 100, 0.1);
    border-color: #495464 !important;
}

/* ----------------------------
   Buttons
   ---------------------------- */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(73, 84, 100, 0.25) !important;
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fetch-button {
    background-color: #495464;
    border-color: #495464;
}

.download-all-button {
    background-color: #BBBFCA;
    border-color: #BBBFCA;
    color: white;
}

.download-selected-button {
    background-color: #495464;
    border-color: #495464;
    color: white;
}

.select-all-button {
    background-color: #E8E8E8;
    color: #495464;
}

/* ----------------------------
   Loading Spinner
   ---------------------------- */
.spinner {
    border: 3px solid rgba(187, 191, 202, 0.2);
    border-top: 3px solid #495464;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ----------------------------
   Progress Bar
   ---------------------------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #E8E8E8 0%, #F4F4F2 100%);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #495464 0%, #BBBFCA 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(73, 84, 100, 0.3);
}

/* ----------------------------
   Cards & Sections
   ---------------------------- */
#controls-section {
    border: 2px solid #E8E8E8;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

#selection-controls button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#selection-controls button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.preview-container {
    background-color: #E8E8E8;
}

/* ----------------------------
   Image Grid & Items
   ---------------------------- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 4px;
}

.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #E8E8E8;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.image-item:nth-child(1) { animation-delay: 0.05s; }
.image-item:nth-child(2) { animation-delay: 0.1s; }
.image-item:nth-child(3) { animation-delay: 0.15s; }
.image-item:nth-child(4) { animation-delay: 0.2s; }
.image-item:nth-child(5) { animation-delay: 0.25s; }
.image-item:nth-child(6) { animation-delay: 0.3s; }
.image-item:nth-child(7) { animation-delay: 0.35s; }
.image-item:nth-child(8) { animation-delay: 0.4s; }
.image-item:nth-child(9) { animation-delay: 0.45s; }

.image-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 28px rgba(73, 84, 100, 0.25);
    border-color: #BBBFCA;
}

.image-item.selected {
    outline: 3px solid #495464;
    outline-offset: 2px;
    box-shadow: 0 8px 20px rgba(73, 84, 100, 0.3);
}

.image-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-item:hover img {
    transform: scale(1.08);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(73, 84, 100, 0.4) 0%, rgba(187, 191, 202, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-item.selected .image-overlay {
    opacity: 1;
    background: linear-gradient(135deg, rgba(73, 84, 100, 0.2) 0%, rgba(187, 191, 202, 0.4) 100%);
}

/* ----------------------------
   Checkboxes
   ---------------------------- */
.image-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    accent-color: #495464;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ----------------------------
   Message Box
   ---------------------------- */
#message-box {
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}