/* Admin Styles */
.admin-body {
    background: #f8f9fa;
    font-family: 'Poppins', sans-serif;
}

.login-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-strong);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Admin Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background: var(--primary-50);
    color: var(--primary-700);
}

.sidebar-nav .icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.welcome {
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-content {
    flex: 1;
    padding: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: 12px;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.article-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.article-image {
    flex-shrink: 0;
}

.article-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.article-content {
    flex: 1;
}

.article-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.article-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.article-actions {
    display: flex;
    gap: 8px;
}

/* Category Stats */
.category-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.action-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.action-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Forms */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.image-preview {
    margin-top: 12px;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background: var(--bg-secondary);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Subcategories Styles */
.subcategories-grid {
    display: grid;
    gap: 24px;
}

.category-group {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 200px;
}

.subcategory-item.predefined {
    background: var(--primary-50);
    border-color: var(--primary);
}

.subcategory-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subcategory-name {
    font-weight: 600;
    color: var(--text-primary);
}

.subcategory-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.subcategory-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.predefined-subcategories {
    display: grid;
    gap: 20px;
}

.section-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* Chart Styles */
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        order: 2;
    }
    
    .admin-main {
        order: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .article-item {
        flex-direction: column;
    }
    
    .article-image {
        align-self: center;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .category-stats {
        grid-template-columns: 1fr;
    }
}

/* Section Divider Styles */
.section-divider {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 2px solid #f0f0f0;
}

.section-divider h3 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-divider p {
    color: var(--text-secondary);
    margin: 0;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #10b981;
    color: white;
}

.badge-warning {
    background: #f59e0b;
    color: white;
}

.badge-info {
    background: #3b82f6;
    color: white;
}

.badge-secondary {
    background: #6b7280;
    color: white;
}

/* Subcategory Actions */
.subcategory-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.subcategory-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

.subcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.subcategory-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subcategory-name {
    font-weight: 600;
    color: var(--text-primary);
}

.subcategory-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* YouTube Configuration Styles */
.channel-info {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.channel-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.channel-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.channel-details h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.channel-details p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.channel-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.channel-stats span {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.live-streams-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.live-stream-item {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e5e7eb;
}

.stream-thumbnail {
    position: relative;
    flex-shrink: 0;
}

.stream-thumbnail img {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.stream-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stream-info h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stream-info p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.stream-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.current-stream {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 24px;
}

.stream-preview {
    position: relative;
    flex-shrink: 0;
}

.stream-thumbnail-large {
    width: 320px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.stream-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.stream-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stream-details h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.stream-details p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.stream-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stream-stats span {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instruction-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.step-content a:hover {
    text-decoration: underline;
}

/* Responsive YouTube Config */
@media (max-width: 768px) {
    .channel-header {
        flex-direction: column;
        text-align: center;
    }
    
    .channel-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .live-stream-item {
        flex-direction: column;
    }
    
    .stream-thumbnail img {
        width: 100%;
        height: 180px;
    }
    
    .current-stream {
        flex-direction: column;
    }
    
    .stream-thumbnail-large {
        width: 100%;
        height: 200px;
    }
    
    .stream-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stream-stats {
        flex-direction: column;
        gap: 8px;
    }
}