/* Painel de Administração Secreta */

#admin-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    font-family: 'Inter', sans-serif;
}

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

.admin-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    margin: 5% auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #2d1b69 0%, #4a3c6b 100%);
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
}

.admin-tab {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.admin-tab:hover {
    background: rgba(45, 27, 105, 0.05);
    color: #2d1b69;
}

.admin-tab.active {
    color: #2d1b69;
    border-bottom-color: #2d1b69;
    background: white;
}

.admin-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

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

.admin-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2d1b69;
    font-size: 1.3rem;
}

.articles-list,
.images-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-item,
.image-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.article-item:hover,
.image-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.article-header,
.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.article-header h4,
.image-header h4 {
    margin: 0;
    color: #2d1b69;
    font-size: 1.1rem;
}

.btn-toggle,
.btn-save,
.btn-cancel {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-toggle {
    background: #2d1b69;
    color: white;
}

.btn-toggle:hover {
    background: #4a3c6b;
    transform: translateY(-2px);
}

.btn-save {
    background: #28a745;
    color: white;
}

.btn-save:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.article-editor {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2d1b69;
    box-shadow: 0 0 0 3px rgba(45, 27, 105, 0.1);
}

.form-control textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 3px solid #2d1b69;
    border-radius: 4px;
}

.form-group small code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #2d1b69;
}

.btn-load-html {
    transition: all 0.3s ease;
}

.btn-load-html:hover {
    background: #138496 !important;
    transform: translateY(-2px);
}

.btn-load-html:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-preview {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.loading,
.error {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.error {
    color: #dc3545;
}

/* Responsivo */
@media (max-width: 768px) {
    .admin-container {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }

    .admin-header {
        padding: 1rem;
    }

    .admin-header h2 {
        font-size: 1.2rem;
    }

    .admin-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .admin-tab-content {
        padding: 1rem;
    }

    .article-header,
    .image-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

