/* Admin Panel Styles */

/* Admin Hero Section */
.admin-hero {
    padding: 8rem 1rem 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.admin-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.admin-hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.admin-hero-title i {
    font-size: 3.5rem;
    color: #f59e0b;
}

.admin-hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Admin Content */
.admin-content {
    padding: 4rem 1rem;
    background: #f9fafb;
    min-height: 100vh;
}

.admin-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: #2563eb;
}

.video-count {
    font-size: 1rem;
    font-weight: 400;
    color: #6b7280;
    margin-left: 0.5rem;
}

/* Upload Form */
.upload-form {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Video Filters */
.video-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e5e7eb;
}

.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Video List */
.video-list {
    display: grid;
    gap: 1rem;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.video-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

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

.video-info {
    flex: 1;
    min-width: 0;
}

.video-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.video-category {
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-hero-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-hero-title i {
        font-size: 3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .video-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .video-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .video-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .admin-hero {
        padding: 6rem 1rem 2rem;
    }
    
    .admin-hero-title {
        font-size: 2rem;
    }
    
    .admin-hero-title i {
        font-size: 2.5rem;
    }
    
    .admin-section {
        padding: 1.5rem;
    }
    
    .upload-form {
        padding: 1rem;
    }
    
    .video-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        text-align: center;
    }
}

/* User Management Styles */
.user-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.add-user-form {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.add-user-form h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-user-form h3::before {
    content: "👤";
    font-size: 1.5rem;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.password-input-group input {
    flex: 1;
}

.btn-generate {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-generate:hover {
    background: #059669;
    transform: translateY(-1px);
}

.users-list {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.users-list h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.users-list h3::before {
    content: "👥";
    font-size: 1.5rem;
}

.users-table {
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.user-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.user-email {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.user-role.admin {
    background: #fef3c7;
    color: #92400e;
}

.user-role.user {
    background: #dbeafe;
    color: #1e40af;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-delete-user {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.btn-delete-user:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-reset-password {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.btn-reset-password:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.temp-password-display {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.temp-password-display h4 {
    color: #0c4a6e;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.temp-password-display .password-text {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0369a1;
    background: white;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 2px dashed #0ea5e9;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.temp-password-display .copy-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.temp-password-display .copy-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

/* Responsive User Management */
@media (max-width: 768px) {
    .user-management {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .password-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-generate {
        width: 100%;
        justify-content: center;
    }
}
