/* Hardware Video Plugin - Optimized Frontend Styles */

/* ===== CORE LAYOUT ===== */
.hardware-videos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fafafa;
    min-height: 100vh;
}

/* ===== SEARCH SECTION (Logo Colors) ===== */
.video-search-section {
    background: linear-gradient(135deg, #1e40af 0%, #dc2626 100%);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.video-search-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.search-controls {
    display: grid;
    grid-template-columns: 300px 1fr auto;
    gap: 24px;
    align-items: end;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .search-controls { grid-template-columns: 1fr; gap: 16px; }
}

.category-filter, .search-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-filter label, .search-box label {
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.category-select, .video-search-input {
    padding: 16px 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255,255,255,0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #1f2937;
    width: 100%;
    font-weight: 500;
}

.category-select:focus, .video-search-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,1);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.search-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: 2px solid rgba(255,255,255,0.3);
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===== VIDEO CATEGORIES ===== */
.video-category-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
    animation: fadeInUp 0.6s ease-out;
}

.category-header {
    text-align: center;
    margin-bottom: 24px;
}

.category-title {
    color: #1e40af;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.category-description {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 8px;
}

.video-count {
    display: inline-block;
    background: linear-gradient(135deg, #1e40af 0%, #dc2626 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===== VIDEO GRID ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #1e40af;
}

.video-card.hidden { display: none; }
.video-card.visible { display: block; }

.video-thumbnail {
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.video-thumbnail img, .video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img,
.video-card:hover .video-thumbnail video {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.video-card:hover .play-overlay {
    background: rgba(30, 64, 175, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 16px;
}

.video-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ===== VIEW ALL BUTTON ===== */
.category-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.view-all-btn {
    background: linear-gradient(135deg, #1e40af 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.view-all-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.35);
}

.view-all-btn.expanded {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* ===== HIDDEN VIDEOS ANIMATION ===== */
.hidden-videos {
    animation: fadeInUp 0.5s ease-out;
}

/* ===== EMPTY STATES ===== */
.no-videos, .no-results-message {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 2px solid rgba(30, 64, 175, 0.1);
    border-radius: 16px;
    margin: 20px 0;
}

.no-videos::before, .no-results-message::before {
    content: '🔍';
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-videos h3, .no-results-message h3 {
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 1.375rem;
    font-weight: 700;
}

.no-videos p, .no-results-message p {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

/* ===== MODAL ===== */
.video-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.modal-close:hover { color: #dc2626; }

.modal-body {
    padding: 24px;
}

#modal-video-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

#modal-video-container iframe,
#modal-video-container video {
    width: 100%;
    height: 450px;
    border-radius: 8px;
}

/* ===== UTILITIES ===== */
.clear-search-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3);
}

.clear-search-btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hardware-videos-container { padding: 16px; }
    .video-search-section { padding: 24px; }
    .videos-grid { grid-template-columns: 1fr; gap: 16px; }
    .video-card { margin-bottom: 16px; }
    .modal-content { max-width: 95vw; }
    #modal-video-container iframe,
    #modal-video-container video { height: 250px; }
}

@media (max-width: 480px) {
    .category-title { font-size: 1.5rem; }
    .video-search-section { padding: 20px; }
    .search-controls { gap: 12px; }
    .category-select, .video-search-input { padding: 12px 16px; font-size: 14px; }
    .search-btn { padding: 12px 20px; min-width: 100px; }
}
