/* Custom styles for Sora2 Prompt Generator */

/* Smooth animations */
* {
    transition: all 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #8b5cf6, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #7c3aed, #2563eb);
}

/* Style button active state */
.style-btn.active {
    border-color: #8b5cf6 !important;
    background-color: #f3f4f6;
    color: #7c3aed;
    transform: scale(1.02);
}

/* Hover effects */
.style-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Prompt output styling */
#promptOutput.has-content {
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #374151;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Loading animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Pulse animation for generate button */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .8;
    }
}

/* Card hover effects */
.bg-white {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Form inputs focus effects */
textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Modal animations */
#savedPromptsModal {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

#savedPromptsModal.show {
    animation-name: modalShow;
}

#savedPromptsModal.hide {
    animation-name: modalHide;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalHide {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Saved prompt item styling */
.saved-prompt-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.saved-prompt-item:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.saved-prompt-item .prompt-preview {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.saved-prompt-item .prompt-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: #9ca3af;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Custom select and input styling */
.custom-input-pair {
    position: relative;
}

.custom-input-pair input[type="text"] {
    transition: all 0.3s ease;
}

.custom-input-pair input[type="text"]:focus {
    transform: scale(1.02);
}

/* Enhanced form styling */
select, input[type="text"], textarea {
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

select:hover, input[type="text"]:hover, textarea:hover {
    border-color: #d1d5db;
}

select:focus, input[type="text"]:focus, textarea:focus {
    border-color: #8b5cf6;
    transform: translateY(-1px);
}

/* Category sections */
.category-section {
    background: linear-gradient(135deg, #fefefe 0%, #f9fafb 100%);
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.category-section:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    border-color: #e5e7eb;
}

/* Input section improvements */
.input-section {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.input-section::-webkit-scrollbar {
    width: 6px;
}

.input-section::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.input-section::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #8b5cf6, #3b82f6);
    border-radius: 3px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .style-btn {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .flex.space-x-3 {
        flex-direction: column;
        space-x: 0;
        gap: 8px;
    }
    
    .flex.space-x-3 button {
        width: 100%;
    }
    
    /* Stack select and input vertically on mobile */
    .flex.space-x-2 {
        flex-direction: column;
        space-x: 0;
        gap: 8px;
    }
    
    .input-section {
        max-height: none;
    }
}

/* Animation for showing/hiding custom inputs */
.custom-input-toggle {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced button styles */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

button:not(:disabled):active {
    transform: scale(0.98);
}

/* Progress indicator */
.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.progress-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #8b5cf6;
    transform: scale(1.2);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Custom Style Management */
.delete-custom-style {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.style-btn:hover .delete-custom-style {
    opacity: 1;
}

.delete-custom-style:hover {
    transform: scale(1.1);
}

/* Style management form improvements */
#styleManagementModal .bg-gradient-to-r {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

#styleManagementModal input:focus,
#styleManagementModal textarea:focus,
#styleManagementModal select:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

/* Icon preview animation */
#iconPreview {
    transition: all 0.2s ease;
}

#iconPreview:hover {
    transform: scale(1.05);
}

/* Custom style grid improvements */
.style-btn {
    position: relative;
    overflow: hidden;
}

.style-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.style-btn:hover::before {
    left: 100%;
}

/* Enhanced modal animations */
.show .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

.hide .bg-white {
    animation: modalSlideOut 0.3s ease-in;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}