/**
 * Área do Anunciante - Design Moderno
 * Cores: Verde #28a745, Laranja #fd7e14, Azul Acinzentado #5a6c7d
 */

:root {
    --verde-primary: #28a745;
    --verde-hover: #218838;
    --laranja-primary: #fd7e14;
    --laranja-hover: #e96d0a;
    --azul-texto: #5a6c7d;
    --cinza-claro: #f8f9fa;
    --cinza-medio: #e9ecef;
    --branco: #ffffff;
    --sombra: 0 2px 8px rgba(0, 0, 0, 0.1);
    --sombra-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--azul-texto);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Container Principal */
.classif-dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header do Dashboard */
.classif-dashboard-header {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--sombra);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.classif-logo-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.classif-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--verde-primary), var(--laranja-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--branco);
    font-size: 24px;
    font-weight: bold;
}

.classif-user-info h2 {
    margin: 0;
    font-size: 24px;
    color: var(--azul-texto);
}

.classif-user-info p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 14px;
}

.classif-header-actions {
    display: flex;
    gap: 10px;
}

.classif-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.classif-btn-primary {
    background: linear-gradient(135deg, var(--verde-primary), var(--verde-hover));
    color: var(--branco) !important;
}

.classif-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
    color: var(--branco) !important;
}

.classif-btn-secondary {
    background: linear-gradient(135deg, var(--laranja-primary), var(--laranja-hover));
    color: var(--branco) !important;
}

.classif-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
    color: var(--branco) !important;
}

/* Navegação por Tabs */
.classif-tabs-nav {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 30px;
    box-shadow: var(--sombra);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.classif-tab-btn {
    flex: 0 0 auto;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--azul-texto);
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.classif-tab-btn:hover {
    background: var(--cinza-medio);
    color: var(--azul-texto);
}

.classif-tab-btn.active {
    background: linear-gradient(135deg, var(--verde-primary), var(--verde-hover));
    color: var(--branco) !important;
}

.classif-tab-btn.active:hover {
    color: var(--branco) !important;
}

.classif-tab-btn i {
    font-size: 18px;
}

/* Conteúdo das Tabs */
.classif-tab-content {
    display: none;
}

.classif-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards de Estatísticas */
.classif-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.classif-stat-card {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--sombra);
    transition: all 0.3s ease;
}

.classif-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

.classif-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.classif-stat-icon.verde {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.2));
    color: var(--verde-primary);
}

.classif-stat-icon.laranja {
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.1), rgba(253, 126, 20, 0.2));
    color: var(--laranja-primary);
}

.classif-stat-icon.azul {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.2));
    color: #0d6efd;
}

.classif-stat-icon.roxo {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1), rgba(111, 66, 193, 0.2));
    color: #6f42c1;
}

.classif-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--azul-texto);
    margin: 10px 0 5px 0;
}

.classif-stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Filtros */
.classif-filters {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--sombra);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.classif-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.classif-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--azul-texto);
    margin: 0;
}

.classif-filter-select,
.classif-filter-input {
    padding: 10px 15px;
    border: 2px solid var(--cinza-medio);
    border-radius: 8px;
    font-size: 14px;
    color: var(--azul-texto);
    min-width: 150px;
    transition: all 0.3s ease;
}

.classif-filter-select:focus,
.classif-filter-input:focus {
    outline: none;
    border-color: var(--verde-primary);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Grid de Anúncios */
.classif-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.classif-ad-card {
    background: var(--branco);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.classif-ad-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

.classif-ad-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--cinza-claro);
}

.classif-ad-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.classif-ad-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--azul-texto);
    margin: 0 0 10px 0;
}

.classif-ad-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 15px 0;
    flex: 1;
}

.classif-ad-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.classif-ad-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--verde-primary);
}

.classif-ad-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.classif-badge-active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--verde-primary);
}

.classif-badge-pending {
    background: rgba(253, 126, 20, 0.1);
    color: var(--laranja-primary);
}

.classif-badge-inactive {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.classif-ad-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 15px;
}

.classif-ad-actions {
    display: flex;
    gap: 10px;
}

.classif-btn-icon {
    padding: 8px 16px;
    font-size: 13px;
}

/* Modal */
.classif-modal {
    display: none;
    position: fixed;
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.classif-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.classif-modal-content {
    background: var(--branco);
    border-radius: var(--radius);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.classif-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--cinza-medio);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.classif-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--azul-texto);
    margin: 0;
}

.classif-modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--cinza-claro);
    border-radius: 50%;
    font-size: 24px;
    color: var(--azul-texto);
    cursor: pointer;
    transition: all 0.3s ease;
}

.classif-modal-close:hover {
    background: var(--cinza-medio);
    transform: rotate(90deg);
}

.classif-modal-body {
    padding: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .classif-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .classif-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .classif-btn {
        width: 100%;
        justify-content: center;
    }

    .classif-tabs-nav {
        flex-wrap: wrap;
    }

    .classif-filters {
        flex-direction: column;
    }

    .classif-filter-group {
        width: 100%;
    }

    .classif-filter-select,
    .classif-filter-input {
        width: 100%;
    }

    .classif-ads-grid {
        grid-template-columns: 1fr;
    }

    .classif-modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Animações de Loading */
.classif-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--branco);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.classif-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--branco);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
}

.classif-empty-icon {
    font-size: 64px;
    color: var(--cinza-medio);
    margin-bottom: 20px;
}

.classif-empty-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--azul-texto);
    margin-bottom: 10px;
}

.classif-empty-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
}

/* ========== SELECT2 CUSTOMIZAÇÃO ========== */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #ced4da;
    border-radius: 8px;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    color: var(--azul-texto);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--verde-primary);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid var(--verde-primary);
    border-radius: 8px;
    box-shadow: var(--sombra);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--verde-primary);
    color: white;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: var(--cinza-medio);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 12px;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--verde-primary);
    outline: none;
}

/* ========== SWEETALERT2 Z-INDEX FIX ========== */
/* Garantir que SweetAlert sempre fique acima do modal */
.swal2-container {
    z-index: 99999 !important;
}

.swal2-popup {
    z-index: 99999 !important;
}

/* ========== FORMULÁRIO DE LOGIN WORDPRESS ========== */
/* Estilizar o formulário nativo do wp_login_form */
.classif-dashboard-header h1 {
    font-size: 2rem;
    color: var(--azul-texto);
    margin: 0;
}

.classif-dashboard-header p {
    color: #6c757d;
    margin: 10px 0 0 0;
}

/* Formulário de login do WordPress */
#loginform {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#loginform p {
    margin: 0;
}

#loginform label {
    display: block;
    font-weight: 500;
    color: var(--azul-texto);
    margin-bottom: 5px;
    font-size: 14px;
}

#loginform input[type="text"],
#loginform input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--cinza-medio);
    border-radius: 8px;
    font-size: 15px;
    color: var(--azul-texto);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus {
    outline: none;
    border-color: var(--verde-primary);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

#loginform .login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
}

#loginform .login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

#loginform input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--verde-primary);
}

#loginform input[type="submit"] {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--verde-primary), var(--verde-hover));
    color: var(--branco);
    width: 100%;
}

#loginform input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

/* Link de recuperação de senha */
#loginform+p a,
.card-body>p a {
    color: var(--verde-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

#loginform+p a:hover,
.card-body>p a:hover {
    color: var(--verde-hover);
    text-decoration: underline;
}

/* Formulário de Cadastro */
#classif-register-form .form-label {
    font-weight: 500;
    color: var(--azul-texto);
    font-size: 14px;
}

#classif-register-form .form-control {
    padding: 12px 15px;
    border: 2px solid var(--cinza-medio);
    border-radius: 8px;
    font-size: 15px;
    color: var(--azul-texto);
    transition: all 0.3s ease;
}

#classif-register-form .form-control:focus {
    border-color: var(--laranja-primary);
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.15);
}

/* Cards de Login/Cadastro */
.card {
    border: none;
    box-shadow: var(--sombra);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    border-bottom: none;
    padding: 15px 20px;
}

.card-header h4 {
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* ========== DROPZONE THUMBNAILS ========== */
/* Corrigir tamanho e exibição das imagens na galeria */
#ad-gallery-dropzone .dz-preview {
    display: inline-block;
    margin: 10px;
}

#ad-gallery-dropzone .dz-preview .dz-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

#ad-gallery-dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#ad-gallery-dropzone .dz-preview .dz-details {
    display: none;
}

#ad-gallery-dropzone .dz-preview .dz-success-mark,
#ad-gallery-dropzone .dz-preview .dz-error-mark {
    display: none;
}

#ad-gallery-dropzone .dz-preview.dz-complete .dz-success-mark {
    display: block;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--verde-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ad-gallery-dropzone .dz-preview.dz-complete .dz-success-mark svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

#ad-gallery-dropzone .dz-preview .dz-remove {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--laranja-primary);
    margin-top: 5px;
    text-decoration: none;
}

#ad-gallery-dropzone .dz-preview .dz-remove:hover {
    color: var(--laranja-hover);
    text-decoration: underline;
}

/* Sortable drag states */
#ad-gallery-dropzone .dz-preview.sortable-ghost {
    opacity: 0.4;
    background: var(--cinza-medio);
    border: 2px dashed var(--verde-primary);
    border-radius: 8px;
}

#ad-gallery-dropzone .dz-preview.sortable-chosen {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

#ad-gallery-dropzone .dz-preview {
    cursor: grab;
}