/* Custom Styles for YouTube Analytics Dashboard */

/* Font */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Table hover effects */
tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: #f9fafb;
}

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

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-color: #f3f4f6;
    }
    50% {
        background-color: #e5e7eb;
    }
    100% {
        background-color: #f3f4f6;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

/* Modal backdrop animation */
#videoDetailModal {
    transition: opacity 0.3s ease;
}

#videoDetailModal.show {
    opacity: 1;
}

#videoDetailModal.hide {
    opacity: 0;
}

/* Custom select styling */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Percentage colors */
.ctr-low { color: #dc2626; }
.ctr-medium { color: #f59e0b; }
.ctr-high { color: #10b981; }

/* Thumbnail styling */
.video-thumbnail {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.video-thumbnail:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Cursor styles */
.cursor-zoom-in {
    cursor: zoom-in;
}

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

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Date picker custom styles */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    padding: 0 0.5rem;
    cursor: pointer;
}

/* Responsive table with sticky header */
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    position: relative;
}

.overflow-x-auto table {
    min-width: 1400px;
}

/* Scrollbar styling */
.overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sticky table header */
thead.sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
}

/* Checkbox styling */
input[type="checkbox"] {
    cursor: pointer;
}

/* Selection mode styling */
.select-mode tbody tr {
    cursor: pointer;
}

.select-mode tbody tr:hover {
    background-color: #eff6ff;
}

.select-mode tbody tr.selected {
    background-color: #dbeafe;
}

/* Responsive table */
@media (max-width: 1024px) {
    .overflow-x-auto table {
        min-width: 1400px;
    }
}

/* Print styles */
@media print {
    header, #channelSelector, #periodSelector, #sortSelector, #ctrFilter, #logoutBtn {
        display: none !important;
    }
    
    .bg-gray-50 {
        background-color: white !important;
    }
    
    .shadow-sm {
        box-shadow: none !important;
    }
}