/* Custom CSS for CatCut - Edit by Narrative */
/* Tailwind handles most styling, this is for custom animations and specific components */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for WebKit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

/* Story Segment Styling */
.story-segment {
    position: relative;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.story-segment:hover {
    background-color: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.story-segment.active {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.dark .story-segment:hover {
    background-color: rgba(245, 158, 11, 0.05);
}

.dark .story-segment.active {
    background-color: rgba(245, 158, 11, 0.15);
}

.segment-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.lock-btn {
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.lock-btn:hover {
    background-color: rgba(245, 158, 11, 0.2);
}

.lock-btn[data-locked="true"] {
    color: #f59e0b;
}

.lock-btn[data-locked="false"] {
    color: #94a3b8;
}

.segment-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #1e293b;
    margin: 0;
    padding-right: 2rem;
}

.dark .segment-text {
    color: #e2e8f0;
}

.segment-metadata {
    margin-top: 0.5rem;
}

.match-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.match-status.matched {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.match-status.searching {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Text highlighting for active words */
.highlight-word {
    background-color: rgba(245, 158, 11, 0.3);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    animation: pulse 2s infinite;
}

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

/* FAB Animation */
#fab-toggle-view {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

#fab-toggle-view:hover {
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.4);
}

.fab-icon-container {
    position: relative;
}

.fab-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-icon.active {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.fab-icon.inactive {
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
}

/* Clip Timeline Styles */
.clip-timeline {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    overflow-x: auto;
    gap: 0.5rem;
    min-height: 120px;
}

.dark .clip-timeline {
    background-color: #1e293b;
}

.clip-card {
    flex-shrink: 0;
    width: 120px;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
}

.dark .clip-card {
    background: #334155;
}

.clip-card:hover {
    border-color: #f59e0b;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clip-card.active {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.clip-card.locked {
    border-color: #94a3b8;
}

.clip-card.locked::after {
    content: "🔒";
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.75rem;
}

.clip-thumbnail {
    width: 100%;
    height: 67.5px;
    object-fit: cover;
    background-color: #e2e8f0;
}

.dark .clip-thumbnail {
    background-color: #475569;
}

.clip-info {
    padding: 0.5rem;
}

.clip-duration {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.dark .clip-duration {
    color: #94a3b8;
}

.clip-name {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .clip-name {
    color: #e2e8f0;
}

/* AI Suggestion Cards */
.ai-suggestion-card {
    transition: all 0.3s ease;
}

.ai-suggestion-card:hover {
    transform: translateX(4px);
}

/* Modal Animations */
#export-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#export-modal.active > div {
    transform: scale(1);
}

/* Platform Button Styles */
.platform-btn.active {
    border-color: #f59e0b !important;
    background-color: rgba(245, 158, 11, 0.1) !important;
}

/* Voice Recording Animation */
.voice-recording {
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Loading animation */
.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #ai-suggestions-panel {
        display: none;
    }
    
    .clip-timeline {
        padding: 0.5rem;
    }
    
    .clip-card {
        width: 100px;
    }
    
    #fab-toggle-view {
        bottom: 1rem;
        right: 1rem;
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Print styles */
@media print {
    #fab-toggle-view,
    .segment-controls,
    .lock-btn {
        display: none;
    }
    
    .story-segment {
        border: 1px solid #e2e8f0;
        page-break-inside: avoid;
    }
}