/* Video Gallery Styles */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.page-header h2 {
    margin: 0;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.video-thumbnail {
    height: 250px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .play-icon {
    opacity: 1;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.video-info p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.page-info {
    color: #666;
    font-size: 14px;
}

/* Management Styles */
.management-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.management-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9ff;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #5568d3;
}

.upload-area.dragging {
    background: #e8ebff;
    border-color: #4558c3;
}

.upload-area p {
    margin: 5px 0;
    color: #667eea;
    font-weight: 500;
}

/* Video Management List */
.video-management-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.video-item:hover {
    background: #f0f0f0;
}

.video-item.dragging {
    opacity: 0.5;
    border-color: #667eea;
}

.video-drag-handle {
    cursor: move;
    color: #999;
    font-size: 20px;
    user-select: none;
    display: flex;
    align-items: center;
}

.video-item .video-thumbnail {
    height: 250px;
    width: 200px;
    height: 120px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
}

.video-item-info {
    flex: 1;
    position: relative;
}

.video-item-order {
    position: absolute;
    top: 0;
    left: 0;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.video-item-info h4 {
    margin: 30px 0 10px 0;
    font-size: 16px;
    color: #333;
}

.video-item-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.video-item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .video-item {
        flex-direction: column;
    }
    
    .video-item .video-thumbnail {
    height: 250px;
        width: 100%;
        height: 200px;
    }
    
    .video-item-actions {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* Smaller buttons for management actions */
.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.2;
}

/* Make video item actions more compact */
.video-item-actions {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

/* Adjust video item layout for better visibility */
.video-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

/* Red delete button */
.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Make all buttons in page header same size */
.page-header .btn,
.page-header button {
    padding: 10px 20px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    height: auto !important;
    box-sizing: border-box;
}

/* Make upload area more prominent and obviously clickable */
.upload-area {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.upload-area:hover {
    background-color: #e8eeff !important;
    border-color: #667eea !important;
    transform: scale(1.01);
}

.upload-area:active {
    transform: scale(0.99);
}
