/* Custom styles for 영업의 기술 AI */

/* Smooth transitions between screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Tab active state */
.tab-btn {
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: #1e3a5f;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

/* File drop zone */
.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.drop-zone.has-file {
    border-color: #22c55e;
    background: #f0fdf4;
    border-style: solid;
}

/* Loading animation */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1e3a5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
}

/* Progress bar animation */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #1e3a5f, #3b82f6, #1e3a5f);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Needs bar animation */
.needs-bar {
    transition: width 0.8s ease-out;
}

/* Card hover effect */
.result-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Button pulse */
.btn-primary {
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Image preview grid */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

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

.image-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #dc2626;
}

/* Hide scrollbar for mobile */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Input focus styles */
input:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* API key visibility toggle */
.api-key-input {
    font-family: monospace;
    letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .drop-zone {
        padding: 24px 16px;
    }

    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
