/* ============================================================
   Vitrine Social UI
   Camada visual adicional, carregada apenas nas paginas publicas
   (request()->is('vitrine*')). Nao remove nem substitui nenhum
   estilo existente — apenas adiciona o "tema social" no topo,
   na barra lateral e na navegacao mobile.
   ============================================================ */

:root {
    --social-green: #1dbf73;
    --social-green-dark: #19a463;
    --social-blue: #3b82f6;
    --social-ink: #1a202c;
    --social-muted: #65676b;
    --social-bg: #f0f2f5;
    --social-border: #e4e6eb;
    --social-radius: 14px;
    --social-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wrapper {
    background: var(--social-bg);
}

/* ===================== NAVBAR ESTILO REDE SOCIAL ===================== */

.main-header.navbar-social {
    background: #ffffff !important;
    border-bottom: 1px solid var(--social-border);
    box-shadow: var(--social-shadow);
    padding: 0 .5rem;
    min-height: 58px;
}

.main-header.navbar-social .navbar-nav {
    align-items: center;
}

.navbar-social .brand-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .75rem;
    font-weight: 700;
    color: var(--social-green-dark);
    text-decoration: none;
    white-space: nowrap;
}

.navbar-social .brand-pill img {
    height: 32px;
    width: auto;
    border-radius: 8px;
}

.navbar-social .brand-pill span {
    font-size: 1.05rem;
}

@media (max-width: 991px) {
    .navbar-social .brand-pill span { display: none; }
}

/* Busca central, tipo Facebook/LinkedIn */
.navbar-search-form {
    flex: 1 1 auto;
    max-width: 420px;
    margin: 0 .75rem;
}

.navbar-search-form .input-group {
    background: var(--social-bg);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color .2s ease, background-color .2s ease;
}

.navbar-search-form .input-group:focus-within {
    background: #ffffff;
    border-color: var(--social-green);
    box-shadow: 0 0 0 3px rgba(29, 191, 115, .12);
}

.navbar-search-form input.form-control {
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: .85rem;
    padding-left: 1rem;
}

.navbar-search-form input.form-control:focus {
    background: transparent;
    box-shadow: none;
}

.navbar-search-form button {
    background: transparent;
    border: none;
    color: var(--social-muted);
    padding: 0 .9rem;
}

@media (max-width: 768px) {
    .navbar-search-form { display: none; }
}

/* Icones centrais de navegacao (Home, Freelancers, Servicos...) */
.navbar-social-icons {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.navbar-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 50px;
    border-radius: 10px;
    color: var(--social-muted) !important;
    font-size: 1.05rem;
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}

.navbar-icon-link:hover {
    background: var(--social-bg);
    color: var(--social-ink) !important;
}

.navbar-icon-link.active {
    color: var(--social-green-dark) !important;
}

.navbar-icon-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: var(--social-green);
}

.navbar-icon-link small {
    font-size: .6rem;
    font-weight: 600;
    margin-top: 2px;
}

@media (max-width: 991px) {
    .navbar-social-icons { display: none; }
}

/* Avatar do utilizador autenticado no topo */
.navbar-social .user-menu .nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: var(--social-bg);
}

.navbar-social .user-menu .nav-link:hover {
    background: var(--social-border);
}

.navbar-social .user-image {
    width: 30px;
    height: 30px;
}

/* ===================== SIDEBAR: CARTAO DE BOAS-VINDAS ===================== */

.sidebar-welcome-card {
    margin: .75rem .5rem 1rem;
    padding: 1rem .9rem;
    border-radius: var(--social-radius);
    background: linear-gradient(145deg, rgba(29, 191, 115, .16) 0%, rgba(15, 23, 42, 0) 70%);
    border: 1px solid rgba(29, 191, 115, .25);
}

.sidebar-welcome-card .welcome-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--social-green) 0%, var(--social-green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: .6rem;
    box-shadow: 0 4px 10px rgba(29, 191, 115, .35);
}

.sidebar-welcome-card .welcome-text strong {
    display: block;
    color: #fff;
    font-size: .92rem;
    line-height: 1.3;
}

.sidebar-welcome-card .welcome-text span {
    display: block;
    color: rgba(255, 255, 255, .65);
    font-size: .76rem;
    margin-top: .15rem;
    margin-bottom: .75rem;
}

.sidebar-welcome-card .welcome-cta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    width: 100%;
    justify-content: center;
    background: var(--social-green);
    color: #fff;
    padding: .45rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease;
}

.sidebar-welcome-card .welcome-cta:hover {
    background: var(--social-green-dark);
    color: #fff;
    text-decoration: none;
}

/* Sidebar encolhida (modo so-icones do AdminLTE): evita o texto a quebrar mal */
body.sidebar-collapse .sidebar-welcome-card {
    margin: .75rem .35rem;
    padding: .6rem .25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.sidebar-collapse .sidebar-welcome-card .welcome-avatar {
    margin-bottom: 0;
}

body.sidebar-collapse .sidebar-welcome-card .welcome-text,
body.sidebar-collapse .sidebar-welcome-card .welcome-cta {
    display: none;
}

/* Ao passar o rato (hover-to-expand do AdminLTE), mostra o cartao completo outra vez */
body.sidebar-collapse .main-sidebar:hover .sidebar-welcome-card {
    align-items: stretch;
    padding: 1rem .9rem;
}

body.sidebar-collapse .main-sidebar:hover .sidebar-welcome-card .welcome-avatar {
    margin-bottom: .6rem;
}

body.sidebar-collapse .main-sidebar:hover .sidebar-welcome-card .welcome-text {
    display: block;
}

body.sidebar-collapse .main-sidebar:hover .sidebar-welcome-card .welcome-cta {
    display: inline-flex;
}

/* ===================== IMAGENS: ENQUADRAMENTO CONSISTENTE ===================== */
/* Aplica-se a todas as paginas da vitrine que usam estas classes,
   substituindo as alturas fixas por proporcoes responsivas — a imagem
   fica bem enquadrada e visivel em qualquer tamanho de tela. */

.service-image-container,
.featured-service-card .service-image-container,
.main-image-container {
    height: auto;
    aspect-ratio: 16 / 10;
}

.service-image,
.main-image-container img,
.no-image-placeholder {
    object-position: center center;
}

.service-image {
    object-fit: cover;
}

.main-image-container img {
    object-fit: contain;
}

/* Placeholder "sem imagem/foto/logo" — icone bem enquadrado dentro de um
   circulo com a cor da marca, em vez do icone apagado/cinza anterior.
   Aplica-se aos cards de servicos, freelancers, empresas, projetos e
   publicidades (todos usam estas mesmas classes). */
.no-image-placeholder {
    background: linear-gradient(135deg, #eef2f7 0%, #e2e8f0 100%);
}

.no-image-placeholder i {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(29, 191, 115, .12);
    color: var(--social-green-dark);
    font-size: 1.7rem;
    margin-bottom: .5rem;
}

.no-image-placeholder p {
    color: #94a3b8;
}

/* Icones dentro das tags de informacao (localizacao, categoria, etc.) com
   destaque na cor da marca para ficarem mais visiveis. */
.skill-tag i {
    color: var(--social-green-dark);
}

.skill-tag:hover i {
    color: #fff;
}

/* Avatar padrao (sem foto) do freelancer nos cards — gradiente da marca
   em vez de cinza neutro, consistente com o resto da vitrine. */
.avatar-default {
    background: linear-gradient(135deg, var(--social-green) 0%, var(--social-green-dark) 100%);
}

/* ===================== NOVO VISUAL DOS CARDS (LISTAGENS) ===================== */
/* Aplica-se aos cards de servicos, freelancers, empresas e projetos —
   mesma linguagem visual do feed da pagina inicial: capa com cantos
   arredondados, badge/preco/avatar flutuantes sobre a imagem, e um
   cartao mais "leve" (estilo vidro) com sombra suave. Nenhum dado foi
   removido — apenas reorganizado visualmente sobre a imagem. */

.service-card {
    border-radius: 20px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .07);
}

.service-card:hover {
    box-shadow: 0 18px 38px rgba(15, 23, 42, .14);
}

.service-card .service-image-container {
    border-radius: 20px 20px 0 0;
    overflow: visible;
}

/* .cover-avatar ainda e usado nos cards de Projeto (foto do freelancer
   responsavel sobreposta a capa). Nos demais cards (servicos, freelancers,
   empresas) a categoria/preco/avatar passaram a ficar no corpo do card,
   abaixo do nome/titulo, em vez de flutuar sobre a imagem. */
.cover-avatar {
    position: absolute;
    bottom: -20px;
    left: 14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .95);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
}

.cover-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-avatar .avatar-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.service-card .card-body {
    padding-top: 1.5rem;
}

.freelancer-info .creator-name {
    display: inline-flex;
    align-items: center;
}

.freelancer-info .creator-name i {
    color: var(--social-green-dark);
}

.post-image-wrapper {
    aspect-ratio: 16 / 9;
}

.post-image-wrapper .post-image {
    height: 100%;
    max-height: none;
    object-position: center center;
}

.post-user-avatar img,
.avatar-placeholder {
    object-position: top center;
}

/* Banner de capa dos perfis (freelancer/empresa) — responsivo em vez de altura fixa */
.profile-cover-banner {
    height: 220px;
    border-radius: inherit;
}

.profile-avatar-wrapper {
    width: 120px;
    height: 120px;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    overflow: hidden;
    transition: transform .3s ease;
}

.profile-avatar-wrapper:hover {
    transform: scale(1.05);
}

.profile-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .profile-cover-banner { height: 170px; }
    .profile-avatar-wrapper { width: 100px; height: 100px; }
}

@media (max-width: 480px) {
    .profile-cover-banner { height: 140px; }
    .profile-avatar-wrapper { width: 84px; height: 84px; }
}

/* ===================== CONSISTENCIA DA COR DA MARCA (VERDE DADGE) ===================== */

.btn-primary {
    background-color: var(--social-green);
    border-color: var(--social-green);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--social-green-dark);
    border-color: var(--social-green-dark);
}

a,
.page-link,
.nav-link.active {
    --bs-link-color: var(--social-green-dark);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--social-green) 0%, var(--social-green-dark) 100%);
    border-color: var(--social-green);
}

::selection {
    background: rgba(29, 191, 115, .25);
}

/* ===================== POLIMENTO GERAL DE CONTEUDO ===================== */
/* Aplica-se a todas as paginas da vitrine (freelancers, servicos, ajuda,
   termos, privacidade, etc.) para dar consistencia visual sem alterar
   a estrutura ou o comportamento de cada pagina. */

.card {
    border-radius: 16px;
}

.card:hover {
    transform: translateY(-3px);
}

.btn {
    border-radius: 10px;
}

.btn-sm,
.btn.btn-sm {
    border-radius: 8px;
}

.btn-block.btn-sm,
a.btn-block {
    border-radius: 10px;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.service-badge.category,
.skill-tag {
    border-radius: 999px;
}

.icon-wrapper {
    box-shadow: 0 4px 14px rgba(29, 191, 115, .25);
}

.step-card,
.service-card,
.project-card {
    border-radius: 14px;
}

.alert {
    border-radius: 12px;
}

.modal-content {
    border-radius: 16px;
}

/* ===================== FORMULARIOS E FILTROS (COR DA MARCA) ===================== */
/* Unifica o destaque de formularios/filtros em toda a vitrine com o
   verde Dadge em vez de azul/amarelo genericos do Bootstrap. */

.form-control:focus,
.custom-select:focus {
    border-color: var(--social-green);
    box-shadow: 0 0 0 .2rem rgba(29, 191, 115, .15);
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--social-green);
    background-color: var(--social-green);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px #fff, 0 0 0 .2rem rgba(29, 191, 115, .25);
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: var(--social-green);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--social-green);
}

/* Cabecalho dos cartoes de filtro/busca avancada — verde em vez de azul */
.filter-card .card-header,
.search-header-card .card-header {
    background: linear-gradient(135deg, var(--social-green) 0%, var(--social-green-dark) 100%) !important;
}

/* Cabecalhos secundarios de secao (Informacoes, Galeria, Habilidades...)
   ficam com o mesmo verde da marca em vez do azul "info" generico */
.bg-soft-info {
    background: linear-gradient(135deg, rgba(29, 191, 115, .15) 0%, rgba(25, 164, 99, .1) 100%) !important;
    border-color: rgba(29, 191, 115, .2) !important;
}

/* ===================== ESTADOS VAZIOS (SEM RESULTADOS) ===================== */
/* Troca o alerta amarelo generico por um cartao mais acolhedor e
   alinhado a marca, sem alterar o texto/logica de cada pagina. */

.alert.alert-warning.text-center.py-4 {
    background: linear-gradient(135deg, rgba(29, 191, 115, .06) 0%, rgba(29, 191, 115, .02) 100%);
    border: 1px dashed rgba(29, 191, 115, .3);
    border-radius: 16px;
    color: var(--social-muted);
    padding: 3rem 1.5rem !important;
}

.alert.alert-warning.text-center.py-4 i {
    color: var(--social-green);
    opacity: .55;
}

.alert.alert-warning.text-center.py-4 h5 {
    color: var(--social-ink);
    font-weight: 700;
    margin-top: .5rem;
}

.empty-feed-state {
    background: linear-gradient(135deg, rgba(29, 191, 115, .06) 0%, rgba(29, 191, 115, .02) 100%);
    border: 1px dashed rgba(29, 191, 115, .3);
    border-radius: 16px;
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--social-muted);
}

.empty-feed-state i {
    font-size: 2.5rem;
    color: var(--social-green);
    opacity: .55;
    margin-bottom: 1rem;
    display: block;
}

.empty-feed-state h5 {
    color: var(--social-ink);
    font-weight: 700;
    margin-bottom: .4rem;
}

.empty-feed-state p {
    margin: 0;
    font-size: .9rem;
}

/* ===================== DESTAQUE: VITRINE PREMIUM ===================== */

.featured-section {
    border: 1px solid rgba(245, 158, 11, .25);
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.featured-section .card-header.bg-gradient-primary {
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 45%, #92400e 130%) !important;
    position: relative;
    overflow: hidden;
}

.featured-section .card-header.bg-gradient-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .18), transparent);
    animation: shineSweep 4s ease-in-out infinite;
}

@keyframes shineSweep {
    0% { left: -150%; }
    60% { left: 150%; }
    100% { left: 150%; }
}

.featured-section .card-header i.fa-crown {
    text-shadow: 0 0 10px rgba(245, 158, 11, .8);
}

.featured-service-card {
    border: 1px solid rgba(245, 158, 11, .35);
}

.featured-service-card:hover {
    box-shadow: 0 10px 30px rgba(245, 158, 11, .25);
    border-color: rgba(245, 158, 11, .6);
}

.featured-badge {
    box-shadow: 0 2px 10px rgba(245, 158, 11, .5);
    animation: badgePulse 2.4s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ===================== FEED: BARRA DE CABEÇALHO (estilo Destaque) ===================== */

.feed-section {
    border: 1px solid rgba(29, 191, 115, .2);
}

.feed-section .card-header.bg-gradient-feed {
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 45%, #15803d 130%);
    position: relative;
    overflow: hidden;
}

.feed-section .card-header.bg-gradient-feed::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .18), transparent);
    animation: shineSweep 4s ease-in-out infinite;
}

.feed-section .card-header i.fa-bolt {
    color: #34d399;
    text-shadow: 0 0 10px rgba(29, 191, 115, .8);
}

/* ===================== FEED: AVATAR EM DESTAQUE + "VER MAIS" ===================== */

.post-user-avatar img,
.post-user-avatar .avatar-placeholder {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(29, 191, 115, .55);
}

.see-more-btn {
    background: none;
    border: none;
    padding: 0;
    margin: -6px 0 12px;
    display: inline-block;
    color: var(--social-green-dark);
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
}

.see-more-btn:hover {
    text-decoration: underline;
}

/* ===================== BARRA INFERIOR (MOBILE) ===================== */

.mobile-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: #ffffff;
    border-top: 1px solid var(--social-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}

.mobile-tabbar .tabbar-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-tabbar a,
.mobile-tabbar button {
    flex: 1;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: .45rem 0 calc(.45rem + env(safe-area-inset-bottom, 0px));
    color: var(--social-muted);
    font-size: .65rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-tabbar i {
    font-size: 1.15rem;
}

.mobile-tabbar a.active {
    color: var(--social-green-dark);
}

@media (max-width: 768px) {
    .mobile-tabbar { display: block; }
    .content-wrapper { padding-bottom: 62px; }
}
