/* Admin Page Mobile-First Responsive Styling */

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
}

/* GitHub Auth Section */
#github-auth-section {
    background: rgba(0, 0, 0, 0.03);
    padding: clamp(1rem, 3vh, 1.5rem);
    border-radius: clamp(6px, 1vw, 8px);
    margin-bottom: clamp(1.5rem, 3vh, 2rem);
}

#github-auth-section h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: clamp(0.75rem, 2vh, 1rem);
}

#github-status {
    font-weight: 600;
    margin-bottom: clamp(0.75rem, 2vh, 1rem);
    color: #666;
}

#github-login-form input {
    width: 100%;
    max-width: 500px;
    padding: clamp(10px, 2vh, 12px);
    margin-bottom: clamp(8px, 1.5vh, 10px);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

#github-connect-btn,
#github-logout-btn {
    padding: clamp(10px, 2vh, 12px) clamp(20px, 4vw, 24px);
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
}

#github-connect-btn:hover,
#github-logout-btn:hover {
    background: #218838;
}

#github-logout-btn {
    background: #dc3545;
}

#github-logout-btn:hover {
    background: #c82333;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: clamp(8px, 1.5vw, 12px);
    margin-bottom: clamp(1.5rem, 3vh, 2rem);
    border-bottom: 2px solid #dee2e6;
    flex-wrap: wrap;
}

.tab-btn {
    padding: clamp(10px, 2vh, 12px) clamp(16px, 3vw, 20px);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

/* Admin Sections */
.admin-section {
    background: rgba(0, 0, 0, 0.02);
    padding: clamp(1rem, 3vh, 1.5rem);
    border-radius: clamp(6px, 1vw, 8px);
    margin-bottom: clamp(1.5rem, 3vh, 2rem);
}

.admin-section h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: clamp(1rem, 2.5vh, 1.25rem);
}

/* Video Form */
#video-form {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 12px);
}

#video-form input,
#video-form textarea,
#video-form select {
    width: 100%;
    padding: clamp(10px, 2vh, 12px);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

#video-form textarea {
    resize: vertical;
    min-height: 80px;
}

#video-form button {
    padding: clamp(12px, 2.5vh, 14px) clamp(24px, 5vw, 28px);
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 600;
    transition: background 0.3s ease;
}

#video-form button:hover {
    background: #0056b3;
}

/* Video List */
#videos-list {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vh, 1.25rem);
}

.video-item {
    display: flex;
    gap: clamp(12px, 2.5vw, 16px);
    padding: clamp(12px, 2.5vh, 16px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: clamp(6px, 1vw, 8px);
    flex-wrap: wrap;
}

.video-preview {
    flex-shrink: 0;
    width: clamp(120px, 25vw, 180px);
}

.video-preview img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

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

.video-info h4 {
    font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    margin-bottom: clamp(6px, 1vh, 8px);
}

.video-info p {
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    margin-bottom: clamp(4px, 0.8vh, 6px);
    color: #666;
}

.video-id {
    font-family: monospace;
    color: #495057;
}

.video-description {
    color: #333;
}

.video-link {
    color: #007bff;
    font-weight: 500;
}

.video-date {
    font-size: clamp(0.8rem, 2vw, 0.85rem);
    color: #999;
}

.video-actions {
    display: flex;
    gap: clamp(8px, 1.5vw, 10px);
    align-items: flex-start;
}

.video-actions button {
    padding: clamp(8px, 1.5vh, 10px) clamp(14px, 3vw, 16px);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(0.85rem, 2.2vw, 0.9rem);
    font-weight: 600;
    transition: all 0.3s ease;
}

.video-actions button:first-child {
    background: #ffc107;
    color: #212529;
}

.video-actions button:first-child:hover {
    background: #e0a800;
}

.video-actions button.danger {
    background: #dc3545;
    color: white;
}

.video-actions button.danger:hover {
    background: #c82333;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: clamp(1rem, 3vw, 2rem);
}

.editor-sidebar {
    background: rgba(0, 0, 0, 0.02);
    padding: clamp(1rem, 2.5vh, 1.5rem);
    border-radius: clamp(6px, 1vw, 8px);
    height: fit-content;
}

.editor-sidebar h3 {
    font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    margin-bottom: clamp(0.75rem, 2vh, 1rem);
}

.editor-actions {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 10px);
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

.editor-actions button {
    padding: clamp(8px, 1.5vh, 10px) clamp(12px, 2.5vw, 16px);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2.3vw, 0.95rem);
    font-weight: 600;
}

.editor-actions button:first-child {
    background: #28a745;
    color: white;
}

.editor-actions button:first-child:hover {
    background: #218838;
}

.editor-actions button:nth-child(2) {
    background: #007bff;
    color: white;
}

.editor-actions button:nth-child(2):hover {
    background: #0056b3;
}

.editor-actions button:nth-child(3) {
    background: #dc3545;
    color: white;
}

.editor-actions button:nth-child(3):hover {
    background: #c82333;
}

#articles-list {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 8px);
}

.article-item {
    padding: clamp(8px, 1.5vh, 10px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(0.85rem, 2.2vw, 0.9rem);
    transition: all 0.2s ease;
}

.article-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.editor-main {
    flex: 1;
}

#article-meta {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 12px);
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

#article-meta input {
    padding: clamp(10px, 2vh, 12px);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

#article-title {
    font-weight: 600;
}

/* EasyMDE Customization */
.CodeMirror {
    min-height: 500px;
    font-size: clamp(0.9rem, 2.3vw, 1rem);
}

.editor-toolbar {
    border-radius: 4px 4px 0 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-sidebar {
        order: 2;
    }

    .editor-main {
        order: 1;
    }

    .video-item {
        flex-direction: column;
    }

    .video-preview {
        width: 100%;
    }

    .video-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .tab-navigation {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }
}

/* Login Prompt */
#admin-login-prompt {
    text-align: center;
    padding: clamp(2rem, 5vh, 3rem);
}

#admin-login-prompt h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
}

#admin-login-prompt p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
}

.login-btn {
    padding: clamp(12px, 2.5vh, 15px) clamp(24px, 5vw, 30px);
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 600;
}

.login-btn:hover {
    background: #0056b3;
}
