/* ============================================
   AI Image Generator - Shadcn Style CSS
   ============================================ */

[v-cloak] { display: none !important; }

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

body {
    font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
    background: hsl(0 0% 100%);
    color: hsl(222.2 84% 4.9%);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100vh;
}

/* ============================================
   Scrollbar - shadcn style
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsl(215.4 16.3% 46.9% / 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(215.4 16.3% 46.9% / 0.5);
}

/* ============================================
   Focus Ring
   ============================================ */
.focus-ring:focus-visible {
    outline: 2px solid hsl(222.2 84% 4.9%);
    outline-offset: 2px;
}

/* ============================================
   Keyframes
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid hsl(214.3 31.8% 91.4%);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-white {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    position: relative;
    overflow: hidden;
    background: hsl(210 40% 96.1%);
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        hsl(0 0% 100% / 0.6),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

/* ============================================
   Buttons - shadcn style
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}
.btn:focus-visible {
    outline: 2px solid hsl(222.2 84% 4.9%);
    outline-offset: 2px;
}
.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-primary {
    background: hsl(222.2 47.4% 11.2%);
    color: hsl(210 40% 98%);
}
.btn-primary:hover {
    background: hsl(222.2 47.4% 11.2% / 0.9);
}

.btn-secondary {
    background: hsl(210 40% 96.1%);
    color: hsl(222.2 47.4% 11.2%);
}
.btn-secondary:hover {
    background: hsl(210 40% 96.1% / 0.8);
}

.btn-outline {
    background: transparent;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    color: hsl(222.2 47.4% 11.2%);
}
.btn-outline:hover {
    background: hsl(210 40% 96.1%);
}

.btn-ghost {
    background: transparent;
    color: hsl(222.2 47.4% 11.2%);
}
.btn-ghost:hover {
    background: hsl(210 40% 96.1%);
}

.btn-destructive {
    background: hsl(0 84.2% 60.2%);
    color: hsl(210 40% 98%);
}
.btn-destructive:hover {
    background: hsl(0 84.2% 60.2% / 0.9);
}

.btn-sm {
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.btn-md {
    height: 2.5rem;
    padding: 0 1rem;
}

.btn-lg {
    height: 2.75rem;
    padding: 0 2rem;
}

.btn-icon {
    height: 2.25rem;
    width: 2.25rem;
    padding: 0;
}

/* ============================================
   Input - shadcn style
   ============================================ */
.input {
    display: flex;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 150ms;
    color: hsl(222.2 84% 4.9%);
}
.input::placeholder {
    color: hsl(215.4 16.3% 46.9%);
}
.input:focus {
    outline: none;
    border-color: hsl(214.3 31.8% 80%);
    box-shadow: none;
}
.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============================================
   Select - shadcn style
   ============================================ */
.select {
    display: flex;
    height: 2.5rem;
    width: auto;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background: transparent;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
.select:focus {
    outline: none;
    border-color: hsl(222.2 84% 4.9%);
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9% / 0.1);
}

/* ============================================
   Card - shadcn style
   ============================================ */
.card {
    border-radius: 0.5rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background: hsl(0 0% 100%);
}

/* ============================================
   Badge - shadcn style
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 150ms;
}
.badge-default {
    background: hsl(222.2 47.4% 11.2%);
    color: hsl(210 40% 98%);
}
.badge-secondary {
    background: hsl(210 40% 96.1%);
    color: hsl(222.2 47.4% 11.2%);
}
.badge-outline {
    background: transparent;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    color: hsl(222.2 47.4% 11.2%);
}

/* ============================================
   Modal/Dialog
   ============================================ */
.modal-backdrop {
    background: hsl(0 0% 0% / 0.8);
    backdrop-filter: blur(4px);
}

/* ============================================
   Textarea
   ============================================ */
.textarea {
    display: flex;
    min-height: 80px;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    resize: none;
    font-family: inherit;
    transition: all 150ms;
}
.textarea::placeholder {
    color: hsl(215.4 16.3% 46.9%);
}
.textarea:focus {
    outline: none;
    border-color: hsl(214.3 31.8% 80%);
    box-shadow: none;
}

/* Prompt editor - contenteditable */
.prompt-editor {
    min-height: 80px;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background: white;
    padding: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
    max-height: 200px;
}
.prompt-editor:focus {
    border-color: hsl(214.3 31.8% 80%);
}
.prompt-editor:empty:before {
    content: '';
}
.prompt-placeholder {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    color: hsl(215.4 16.3% 46.9%);
    font-size: 0.875rem;
    pointer-events: none;
}
/* 填空标签样式 */
.prompt-tag {
    display: inline-flex;
    align-items: center;
    background: hsl(210 20% 93%);
    border-radius: 0.25rem;
    padding: 0 0.25rem;
    margin: 0 0.125rem;
    vertical-align: baseline;
}
.prompt-tag .tag-input {
    min-width: 1ch;
    outline: none;
    background: transparent;
    color: hsl(222.2 47.4% 11.2%);
    font-size: 0.8125rem;
}
.prompt-tag .tag-input:empty:before {
    content: attr(data-placeholder);
    color: hsl(215.4 16.3% 46.9%);
}
.prompt-tag .tag-input:focus {
    outline: none;
}

/* ============================================
   Separator
   ============================================ */
.separator {
    height: 1px;
    width: 100%;
    background: hsl(214.3 31.8% 91.4%);
}

/* ============================================
   Image Card Overlay
   ============================================ */
.image-overlay {
    opacity: 0;
    transition: opacity 200ms;
}
.image-card:hover .image-overlay {
    opacity: 1;
}

/* ============================================
   Mobile Sidebar Animation
   ============================================ */
@keyframes slide-in {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
.animate-slide-in {
    animation: slide-in 0.2s ease-out;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}
.animate-slide-in-right {
    animation: slide-in-right 0.2s ease-out;
}

/* Line clamp for template preview */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Mobile Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
    .textarea {
        min-height: 60px;
        font-size: 1rem;
    }
    .prompt-editor {
        min-height: 60px;
        font-size: 1rem;
    }
    
    /* Larger touch targets on mobile */
    .btn-icon {
        height: 2.5rem;
        width: 2.5rem;
    }
}

/* Safe area insets for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

