/* SmartFit Page Styles - Premium Glass Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(30, 41, 59, 0.4);
    --bg-glass-strong: rgba(15, 23, 42, 0.8);
    --border-light: rgba(255, 255, 255, 0.1);
    --clr-primary: #ec4899; /* Pink for Fashion */
    --clr-secondary: #06b6d4; /* Cyan */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --gradient-primary: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Grid */
.fit-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    min-height: 600px;
    margin-top: 20px;
}

/* Card Styles */
.fit-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.fit-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.fit-card h2 i {
    color: var(--clr-primary);
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-box {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-box:hover {
    border-color: var(--clr-primary);
    background: rgba(236, 72, 153, 0.05);
}

.upload-box i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.upload-box h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-main);
}

.upload-box p {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
}

.preview-container:has(img) {
    display: block;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Saved Items */
.saved-items-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.saved-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.saved-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.saved-item.selected {
    border-color: var(--clr-primary);
}

.check-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(236, 72, 153, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.form-group select:focus {
    border-color: var(--clr-primary);
}

/* Batch Mode Info */
.batch-mode-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #06b6d4;
    display: none; /* Hidden by default */
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--clr-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Result Box */
.result-box {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    display: none; /* Hidden by default */
}

.result-box.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.result-box img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

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

/* Sidebar History */
.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 5px;
}

.history-card {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.history-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-card:hover .history-overlay {
    opacity: 1;
}

.history-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.history-btn:hover {
    background: var(--clr-primary);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .fit-container {
        grid-template-columns: 1fr;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        max-height: 300px;
    }
}
