/* Dialog Styles */

#dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.dialog {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 380px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dialog-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.dialog-body {
    padding: 16px 20px;
}

.dialog-body .prop-row {
    margin-bottom: 10px;
}

.dialog-body label {
    min-width: 65px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}
.dialog-footer button {
    width: auto;
    min-width: 80px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 40px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    animation: toast-in 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.success {
    background: var(--success);
    color: white;
}
.toast.error {
    background: var(--danger);
    color: white;
}
.toast.info {
    background: var(--accent);
    color: white;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* AI Image Generation Dialog */
#dialog-ai-generate { max-width: 720px; }
.ai-gen-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #999);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#ai-gen-preview-img.loaded {
    display: block;
    animation: fade-in 0.3s ease-out;
}
@keyframes fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Template Gallery */
#dialog-templates { max-width: 780px; }
.template-card {
    background: var(--bg-dark, #1a1a1a);
    border: 2px solid var(--border, #444);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    overflow: hidden;
}
.template-card:hover {
    border-color: var(--accent, #0078d4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.template-preview {
    height: 180px;
    position: relative;
    overflow: hidden;
}
.template-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.template-color-bar {
    display: flex;
    height: 4px;
}
.template-color-bar span {
    flex: 1;
}
.template-info {
    padding: 10px 12px;
}
.template-info h4 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright, #fff);
}
.template-info p {
    margin: 0;
    font-size: 10px;
    color: var(--text-secondary, #888);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
