* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2ecc71;
    --primary-dark: #27ae60;
    --secondary-color: #3498db;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-color: #2c3e50;
    --bg-color: #ecf0f1;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray: #bdc3c7;
    --gray-dark: #7f8c8d;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login e Cadastro */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-hover);
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

input, textarea, select {
    padding: 12px;
    border: 2px solid var(--gray);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-dark);
}

/* Cards de Anúncios */
.anuncios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.anuncio-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
}

.anuncio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.anuncio-imagem {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.anuncio-info {
    padding: 20px;
}

.anuncio-titulo {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.anuncio-descricao {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anuncio-valor {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.anuncio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categoria-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--text-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-logo {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.sidebar-logo img {
    width: 80px;
    height: 80px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s;
    font-weight: 500;
}

.menu-item:hover, .menu-item.active {
    background: var(--primary-color);
    transform: translateX(5px);
}

.menu-logout {
    margin-top: auto;
    padding: 15px;
    color: var(--danger-color) !important;
    border: 2px solid var(--danger-color);
    text-align: center;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.menu-logout:hover {
    background: var(--danger-color);
    color: var(--white) !important;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
}

.filtros {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.filtro-select {
    padding: 10px 20px;
    border: 2px solid var(--gray);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 200px;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 15px;
    border: 2px solid var(--gray);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.page-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-btn:hover:not(.active) {
    border-color: var(--primary-color);
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        padding: 10px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .anuncios-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Botão flutuante */
.btn-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.btn-float:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}