/* Video Search Styling */
.video-container {
    position: relative;
    display: inline-block;
}

.video-container video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* Ensure consistent video size */
    width: 280px !important;
    height: 280px !important;
    object-fit: cover;
}

/* Fixed width for video column */
.table th:nth-child(4),
.table td:nth-child(4) {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

/* Ensure action column doesn't get too wide */
.table th:nth-child(5),
.table td:nth-child(5) {
    width: 120px;
    min-width: 120px;
}

/* Autocomplete Styling */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-loading {
    padding: 8px 12px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* Form styling */
.form-select[multiple] {
    min-height: 120px;
}

/* Navigation active state */
.navbar-nav .nav-link.active {
    color: #fff !important;
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Card improvements */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 8px;
}

/* Button spacing */
.btn + .btn {
    margin-left: 0.5rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 8px;
}

/* Footer improvements */
footer {
    background-color: #f8f9fa;
    margin-top: auto;
}

/* Word Type Badge Styling */
/* Meanings display styling */
.meanings-display {
    line-height: 1.6;
}

.word-type-section {
    margin-bottom: 12px;
}

.word-type-section:last-child {
    margin-bottom: 0;
}

.word-type-header {
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    text-decoration: underline;
    margin-bottom: 4px;
}

.word-type-content {
    color: #212529;
    font-weight: 400;
    margin-left: 8px;
    line-height: 1.4;
}

/* Special styling for unclassified header */
.word-type-section:first-child .word-type-header {
    color: #6c757d;
}

/* Video responsive */
@media (max-width: 768px) {
    .video-container video {
        width: 100%;
        height: auto;
    }
}

/* Skeleton Loading Styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-text-medium {
    width: 80%;
}

.skeleton-text-full {
    width: 100%;
}

.skeleton-row {
    display: table-row;
}

.skeleton-cell {
    display: table-cell;
    padding: 12px;
    vertical-align: middle;
}

.skeleton-option {
    height: 20px;
    margin-bottom: 4px;
}

.skeleton-select {
    min-height: 120px;
    padding: 8px;
}

/* Loading state for contexts */
#contexts.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Fade in animation for loaded content */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Status badge */
.db-status-badge {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.db-status-badge.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.db-status-badge.ready {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.db-status-badge.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spinner-rotate {
    100% {
        transform: rotate(360deg);
    }
}
