/* Google Whisk Style CSS - Enhanced UI */

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    color: #ffffff;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #0f0f0f 100%);
    min-height: 100vh;
}

/* Custom Scrollbar - Dark Theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #b2e79f 0%, #a8db8e 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a8db8e 0%, #b2e79f 100%);
}

/* Tab Styles - Dark Green */
.tab-btn.active {
    background: linear-gradient(135deg, #b2e79f 0%, #a8db8e 100%);
    color: #000000;
    box-shadow: 0 4px 15px rgba(178, 231, 159, 0.4);
    font-weight: 600;
}

.tab-btn {
    color: #ffffff;
    background: rgba(45, 45, 45, 0.8);
    border: 1px solid rgba(178, 231, 159, 0.2);
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(178, 231, 159, 0.1);
    border-color: rgba(178, 231, 159, 0.4);
}

.history-tab-btn.active {
    background: linear-gradient(135deg, #b2e79f 0%, #a8db8e 100%);
    color: #000000;
    box-shadow: 0 2px 8px rgba(178, 231, 159, 0.4);
    font-weight: 600;
}

/* Aspect Ratio Selection - Green Theme */
.aspect-ratio-option input[type="radio"]:checked + div {
    border-color: #b2e79f;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.15) 0%, rgba(168, 219, 142, 0.15) 100%);
    box-shadow: 0 0 0 1px rgba(178, 231, 159, 0.6);
}

/* Style Preset Selection - Green Theme */
.style-preset-option input[type="radio"]:checked + div {
    border-color: #b2e79f;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.15) 0%, rgba(168, 219, 142, 0.15) 100%);
    box-shadow: 0 0 0 1px rgba(178, 231, 159, 0.6);
}

/* Sidebar Transitions */
#leftSidebar {
    transition: transform 0.3s ease-in-out;
}

#leftSidebar.-translate-x-full {
    transform: translateX(-100%);
}

/* Upload Area Hover Effects - Dark Green */
.upload-area {
    transition: all 0.3s ease;
    background: rgba(45, 45, 45, 0.5);
    border: 2px dashed rgba(178, 231, 159, 0.3);
}

.upload-area:hover {
    border-color: #b2e79f;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.1) 0%, rgba(168, 219, 142, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(178, 231, 159, 0.2);
}

.upload-area.drag-over {
    border-color: #a8db8e;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.2) 0%, rgba(168, 219, 142, 0.2) 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(178, 231, 159, 0.3);
}

/* Video Upload Area Styles */
#videoUploadArea {
    transition: all 0.3s ease;
}

#videoUploadArea:hover {
    border-color: #b2e79f !important;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.1) 0%, rgba(168, 219, 142, 0.1) 100%) !important;
    box-shadow: 0 8px 25px rgba(178, 231, 159, 0.2);
}

/* File Preview Styles - Dark Green */
.file-preview {
    background: rgba(45, 45, 45, 0.6);
    border: 1px solid rgba(178, 231, 159, 0.3);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.file-preview:hover {
    border-color: #b2e79f;
    background: rgba(178, 231, 159, 0.1);
    box-shadow: 0 4px 20px rgba(178, 231, 159, 0.2);
}

/* Character Item Styles - Dark Green */
.character-item {
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(45, 45, 45, 0.6);
    border: 1px solid rgba(178, 231, 159, 0.2);
    backdrop-filter: blur(8px);
}

.character-item:hover {
    border-color: #b2e79f;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.15) 0%, rgba(168, 219, 142, 0.15) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(178, 231, 159, 0.3);
}

.character-item.selected {
    border-color: #a8db8e;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.2) 0%, rgba(168, 219, 142, 0.2) 100%);
    box-shadow: 0 0 0 2px rgba(178, 231, 159, 0.5);
}

/* History Item Styles - Dark Green */
.history-item {
    transition: all 0.3s ease;
    background: rgba(45, 45, 45, 0.5);
    border: 1px solid rgba(178, 231, 159, 0.2);
    backdrop-filter: blur(6px);
}

.history-item:hover {
    border-color: #b2e79f;
    background: linear-gradient(135deg, rgba(178, 231, 159, 0.1) 0%, rgba(168, 219, 142, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(178, 231, 159, 0.25);
}

/* Video Preview Styles - Dark Theme */
#previewContainer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #0f0f0f 100%);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(178, 231, 159, 0.3);
    box-shadow: inset 0 0 50px rgba(178, 231, 159, 0.1);
}

#previewContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

#generatedVideo {
    position: relative;
    z-index: 1;
}

/* Advanced Settings Accordion */
#advancedSettings {
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

#advancedSettings.hidden {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

/* Motion Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #b2e79f;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(178, 231, 159, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(178, 231, 159, 0.4);
}

input[type="range"]::-webkit-slider-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #4a4a4a 0%, #b2e79f 50%, #4a4a4a 100%);
}

input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #b2e79f;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(178, 231, 159, 0.3);
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #4a4a4a 0%, #b2e79f 50%, #4a4a4a 100%);
    border: none;
}

/* Button Enhancements */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Generate Button Special Style */
#generateBtn {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    position: relative;
    overflow: hidden;
}

#generateBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

#generateBtn:hover::before {
    left: 100%;
}

#generateBtn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Template Button Styles */
.template-btn {
    transition: all 0.2s ease;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    border-color: #7c3aed;
}

/* Modal Animations */
.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading Spinner */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* Progress Bar Glow Effect */
#modalProgressBar {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(124, 58, 237, 0.6);
    }
}

/* Drag and Drop Visual Feedback */
.drag-over {
    border-color: #7c3aed !important;
    background-color: #f3f4f6 !important;
    transform: scale(1.02);
}

/* Image Preview Grid */
#characterImagesPreview {
    gap: 8px;
}

#characterImagesPreview .group:hover button {
    display: flex !important;
}

/* Credit Display */
#creditDisplay {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    border: 1px solid #a855f7;
}

/* Navigation Enhancements */
nav {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Quick Prompt Input */
#quickPrompt {
    transition: all 0.3s ease;
}

#quickPrompt:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

/* Sidebar Shadows */
#leftSidebar, #rightSidebar {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Right Sidebar Collapse/Expand Transitions */
#rightSidebar {
    transition: all 0.3s ease-in-out;
}

/* History Panel Toggle Button */
#toggleRightSidebar {
    transition: all 0.3s ease;
}

#toggleRightSidebar:hover {
    transform: scale(1.1);
}

/* File Upload Areas */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #7c3aed;
    background-color: #faf5ff;
}

.file-upload-area.drag-active {
    border-color: #7c3aed;
    background-color: #f3f4f6;
    transform: scale(1.02);
}

/* Video Controls Overlay */
#videoControls {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

/* Notification Styles */
.notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1280px) {
    #rightSidebar {
        display: none;
    }
    
    .max-w-2xl {
        max-width: 400px;
    }
}

@media (max-width: 1024px) {
    #leftSidebar {
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 40;
        transform: translateX(-100%);
    }
    
    #leftSidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    nav .max-w-2xl {
        display: none;
    }
    
    .flex-1 {
        padding: 16px;
    }
    
    #previewContainer {
        min-height: 250px;
    }
    
    .character-item, .history-item {
        padding: 12px;
    }
}

@media (max-width: 640px) {
    nav h1 {
        display: none;
    }
    
    .grid.grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #characterImagesPreview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Focus Styles */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Smooth Transitions */
* {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .border-gray-200 {
        border-color: #000000;
    }
    
    .text-gray-600 {
        color: #000000;
    }
    
    .bg-gray-50 {
        background-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    #leftSidebar,
    #rightSidebar,
    nav {
        display: none;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}