/* SmartImage Specific Styles */
:root {
    --clr-primary: #a855f7;
    --gradient-primary: linear-gradient(135deg, #a855f7, #d946ef);
}

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

/* Card Styles */
.image-card {
    background: var(--bg-card, rgba(30, 41, 59, 0.7));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.image-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main, #f8fafc);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-main, #f8fafc);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.6;
}

/* Mode Selection */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.mode-card.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--clr-primary);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

.mode-card i {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-muted, #94a3b8);
    display: block;
}

.mode-card.active i {
    color: var(--clr-primary);
}

.mode-card span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
}

/* 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;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

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

/* Result Area */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.result-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    position: relative;
    aspect-ratio: 1;
    group: hover;
}

.result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.result-card:hover img {
    transform: scale(1.05);
}

.result-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 15px 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.result-card:hover .result-actions {
    opacity: 1;
}

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

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

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--clr-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* History Section */
.history-section {
    margin-top: 40px;
}

.history-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 1024px) {
    .image-grid { grid-template-columns: 1fr; }
    .mode-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .mode-grid { grid-template-columns: repeat(2, 1fr); }
    .result-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
