#gig-app {
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Prompt area */
.gig-prompt-area {
    margin-bottom: 20px;
}

#gig-prompt {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    border: 2px solid #d0d5dd;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#gig-prompt:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.gig-controls {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.gig-controls select {
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    min-width: 140px;
}

.gig-controls select:focus {
    outline: none;
    border-color: #4285f4;
}

#gig-generate {
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #4285f4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-left: auto;
}

#gig-generate:hover {
    background: #3367d6;
}

#gig-generate:active {
    transform: scale(0.97);
}

#gig-generate:disabled {
    background: #98b8f0;
    cursor: not-allowed;
    transform: none;
}

/* Status */
#gig-status {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#gig-status.loading {
    background: #e8f0fe;
    color: #1a56db;
}

#gig-status.error {
    background: #fce8e8;
    color: #c5221f;
}

#gig-status.success {
    background: #e6f4ea;
    color: #137333;
}

.gig-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #a4c8f7;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: gig-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.gig-hidden {
    display: none !important;
}

/* Result */
#gig-result {
    margin-bottom: 30px;
}

#gig-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e0e3e8;
    text-align: center;
}

#gig-image-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.gig-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.gig-result-actions button {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.gig-result-actions button:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    color: #4285f4;
}

#gig-save-status {
    font-size: 13px;
    color: #137333;
}

/* History */
#gig-history {
    margin-top: 30px;
}

#gig-history h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

#gig-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.gig-history-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e3e8;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.gig-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gig-history-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.gig-history-item .gig-history-prompt {
    padding: 6px 8px;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fafafa;
}

/* Responsive */
@media (max-width: 600px) {
    .gig-controls {
        flex-direction: column;
    }

    .gig-controls select,
    #gig-generate {
        width: 100%;
        margin-left: 0;
    }
}
