﻿/* ================================================================
   TEAM SCAPICOLLO - site.css (COMPLETO, PULITO, SENZA DOPPIONI)
   ================================================================ */

/* ============================================================
   1) VARIABILI
   ============================================================ */
:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --dark-color: #212529;
    --main-nav-h: 56px; /* navbar principale bootstrap */
    --res-nav-h: 38px; /* barra area riservata */
}

/* ============================================================
   2) BASE
   ============================================================ */
body {
    font-family: 'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
    padding-top: 0;
    background: #f5f7fb;
}

.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

main {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: var(--main-nav-h);
}

body.has-second-navbar main {
    padding-top: calc(var(--main-nav-h) + var(--res-nav-h) + 6px) !important;
}

/* ============================================================
   3) NAVBAR PRINCIPALE (DESKTOP + MOBILE STABILE)
   ============================================================ */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all .2s ease;
}

    /* evita che brand+toggler vadano a capo */
    .navbar > .container,
    .navbar > .container-fluid,
    .navbar .container {
        flex-wrap: nowrap !important;
    }

/* brand: non deve spingere il toggler giù */
.navbar-brand {
    min-width: 0;
    max-width: calc(100vw - 70px);
    display: inline-flex;
    align-items: center;
}

/* titolo (tu ora usi "Team Scapicollo") */
.brand-title {
    display: inline-block;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.25rem;
    letter-spacing: .3px;
}

@media (max-width:575.98px) {
    .brand-title {
        font-size: 1.05rem;
        max-width: 70vw;
    }
}

/* link desktop */
.nav-link {
    font-weight: 500;
    transition: all .2s ease;
    position: relative;
}

    .nav-link:hover {
        color: var(--primary-color) !important;
        transform: translateY(-2px);
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--primary-color);
        transition: all .2s ease;
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 80%;
    }

/* ============================================================
   3.1) BOTTONE ACCEDI (verde)
   ============================================================ */
.btn-accedi {
    background: linear-gradient(135deg,#28a745,#20c997);
    color: #fff !important;
    font-weight: 600;
    border-radius: 20px;
    padding: 6px 18px !important;
    margin-left: 10px;
    border: none;
    box-shadow: 0 2px 8px rgba(40,167,69,.35);
    transition: all .2s ease;
}

    .btn-accedi:hover {
        background: linear-gradient(135deg,#218838,#1aa87d);
        color: #fff !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40,167,69,.45);
    }

    .btn-accedi::after {
        display: none !important;
    }

    .btn-accedi:focus {
        color: #fff !important;
        box-shadow: 0 0 0 .2rem rgba(40,167,69,.25);
    }

/* ============================================================
   4) SECONDA NAVBAR — AREA RISERVATA
   ============================================================ */
.navbar-riservata {
    background: linear-gradient(90deg,#5a1010 0%,#8b2020 50%,#5a1010 100%);
    min-height: var(--res-nav-h);
    padding-top: 0;
    padding-bottom: 0;
    position: fixed;
    top: var(--main-nav-h);
    left: 0;
    right: 0;
    z-index: 1029;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.navbar-brand-riservata {
    color: rgba(255,255,255,.55);
    font-size: .78rem;
    letter-spacing: .03em;
    white-space: nowrap;
    padding: 6px 0;
}

    .navbar-brand-riservata i {
        color: rgba(255,255,255,.9);
        font-size: .95rem;
    }

.nav-link-res {
    color: rgba(255,255,255,.82) !important;
    font-size: .82rem;
    padding: 7px 11px !important;
    border-radius: 6px;
    transition: color .2s, background .2s;
    white-space: nowrap;
}

    .nav-link-res:hover {
        color: #fff !important;
        background: rgba(255,255,255,.12);
    }

.btn-esci-res {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.28);
    color: rgba(255,255,255,.92);
    font-size: .80rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 14px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

    .btn-esci-res:hover {
        background: rgba(255,255,255,.20);
        border-color: rgba(255,255,255,.50);
        color: #fff;
    }

/* toggler area riservata: leggibile */
.navbar-toggler-riservata {
    background: rgba(255,255,255,.16);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.40);
    font-size: .85rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

    .navbar-toggler-riservata:hover {
        background: rgba(255,255,255,.26);
        color: #fff !important;
    }

    .navbar-toggler-riservata:focus {
        box-shadow: none;
        outline: none;
        color: #fff !important;
    }

    .navbar-toggler-riservata i {
        color: #fff !important;
    }

/* ============================================================
   5) MOBILE: MENU A PANNELLO SOTTO LE BARRE (NO "IN MEZZO")
   ============================================================ */
@media (max-width:991.98px) {

    /* ---------- MENU PRINCIPALE (pannello sotto navbar scura) ---------- */
    .navbar.navbar-expand-lg.fixed-top .navbar-collapse {
        position: fixed;
        /* di default sotto la navbar principale */
        top: var(--main-nav-h);
        left: 0;
        right: 0;
        z-index: 1030;
        background: #212529; /* bg-dark */
        padding: 14px 16px;
        max-height: calc(100vh - var(--main-nav-h));
        overflow-y: auto;
        box-shadow: 0 12px 26px rgba(0,0,0,.35);
        border-top: 1px solid rgba(255,255,255,.08);
    }

    /* se loggato: il pannello scende sotto anche la barra rossa */
    body.has-second-navbar .navbar.navbar-expand-lg.fixed-top .navbar-collapse {
        top: calc(var(--main-nav-h) + var(--res-nav-h));
        max-height: calc(100vh - (var(--main-nav-h) + var(--res-nav-h)));
    }

    /* link mobile: comodi e senza effetti desktop */
    .navbar.navbar-expand-lg.fixed-top .navbar-nav .nav-link {
        padding: 12px 10px;
        border-radius: 10px;
    }

        .navbar.navbar-expand-lg.fixed-top .navbar-nav .nav-link:hover {
            transform: none;
            background: rgba(255,255,255,.08);
            color: #fff !important;
        }

    .navbar.navbar-expand-lg.fixed-top .nav-link::after {
        display: none;
    }

    /* accedi full width nel pannello */
    .navbar.navbar-expand-lg.fixed-top .btn-accedi {
        width: 100%;
        margin: 10px 0 0 0;
        text-align: center;
        padding: 8px 18px !important;
    }

    /* ---------- MENU AREA RISERVATA (pannello sotto barra rossa) ---------- */
    .navbar-riservata .navbar-collapse {
        position: fixed;
        top: calc(var(--main-nav-h) + var(--res-nav-h));
        left: 0;
        right: 0;
        z-index: 1031; /* sopra al menu principale */
        background: linear-gradient(90deg,#5a1010 0%,#8b2020 50%,#5a1010 100%);
        padding: 12px 14px;
        max-height: calc(100vh - (var(--main-nav-h) + var(--res-nav-h)));
        overflow-y: auto;
        box-shadow: 0 12px 26px rgba(0,0,0,.35);
        border-top: 1px solid rgba(255,255,255,.10);
    }

    .navbar-riservata .navbar-nav .nav-link-res {
        padding: 11px 12px !important;
        border-radius: 10px;
    }

    .navbar-riservata .btn-esci-res {
        width: 100%;
        margin-top: 10px;
        padding: 10px 14px;
        text-align: center;
        display: block;
    }
}

/* ============================================================
   6) HERO
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 600px;
    background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
    background-image: url('https://images.unsplash.com/photo-1544191696-102dbdaeeaa0?w=1600');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,rgba(0,0,0,.5) 0%,rgba(0,0,0,.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 20px;
}

/* ============================================================
   7) SPONSOR RAILS (DESKTOP)
   ============================================================ */
.sponsor-rail {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 3;
    width: 150px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.18);
    backdrop-filter: blur(6px);
}

    .sponsor-rail.sponsor-left {
        left: 18px;
    }

    .sponsor-rail.sponsor-right {
        right: 18px;
    }

.sponsor-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.90);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
}

    .sponsor-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 22px rgba(0,0,0,.22);
    }

    .sponsor-item img {
        width: 100%;
        height: 55px;
        object-fit: contain;
        display: block;
    }

    .sponsor-item.sponsor-round img {
        height: 60px;
        border-radius: 50%;
    }

/* ============================================================
   8) SPONSOR STRIP (MOBILE/TABLET)
   ============================================================ */
.sponsor-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 3;
    padding: 0 12px;
}

.sponsor-strip-inner {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.20);
    backdrop-filter: blur(6px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .sponsor-strip-inner::-webkit-scrollbar {
        display: none;
    }

.sponsor-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.92);
    text-decoration: none;
}

    .sponsor-chip img {
        height: 38px;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .sponsor-chip.sponsor-chip-round img {
        width: 45px;
        height: 45px;
        border-radius: 50%;
    }

.sponsor-strip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 16px;
    animation: arrowPulse 1.6s infinite;
}

    .sponsor-strip-arrow.left {
        left: 6px;
    }

    .sponsor-strip-arrow.right {
        right: 6px;
    }

@keyframes arrowPulse {
    0%,100% {
        opacity: .35;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.08);
    }
}

/* ============================================================
   9) ANIMAZIONI
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 1s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInUp 1s ease-out .3s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 1s ease-out .6s both;
}

/* ============================================================
   10) CARDS / NEWS
   ============================================================ */
.feature-card {
    transition: all .3s ease;
    border-radius: 15px;
}

    .feature-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 10px 30px rgba(0,0,0,.2) !important;
    }

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: rgba(0,102,204,.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card {
    transition: all .3s ease;
    border-radius: 15px;
    overflow: hidden;
}

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0,0,0,.2) !important;
    }

    .news-card img {
        height: 250px;
        object-fit: cover;
        transition: all .3s ease;
    }

    .news-card:hover img {
        transform: scale(1.1);
    }

/* ============================================================
   11) BUTTONS
   ============================================================ */
.btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all .3s ease;
}

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,.2);
    }

.btn-primary {
    background: linear-gradient(135deg,var(--primary-color) 0%,#004999 100%);
    border: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        color: #fff;
    }

.btn-sm {
    padding: .35rem .75rem;
    border-radius: 999px;
}

/* ============================================================
   12) FORMS
   ============================================================ */
.form-control,
.form-select,
textarea.form-control,
input[type="file"].form-control {
    background-color: #fff;
    border: 1px solid #cfd6df;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    border-radius: 12px;
}

    .form-control:focus,
    .form-select:focus,
    textarea.form-control:focus,
    input[type="file"].form-control:focus {
        border-color: rgba(0,102,204,.55);
        box-shadow: 0 0 0 .25rem rgba(0,102,204,.15);
    }

.form-label {
    font-weight: 700;
    color: #212529;
}

.form-control::placeholder {
    color: #8b97a6;
}

.form-check-input {
    border-color: #cfd6df;
}

/* ============================================================
   13) TABLES
   ============================================================ */
.table {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

    .table thead th {
        background: #f0f3f8;
        border-bottom: 1px solid #e1e6ef;
        font-weight: 800;
    }

    .table tbody td {
        border-color: #eef2f7;
    }

.table-responsive {
    border-radius: 14px;
}

/* ============================================================
   14) CARDS / ALERTS / DROPDOWNS / FOOTER
   ============================================================ */
.card {
    border-radius: 14px;
}

    .card.shadow-sm {
        box-shadow: 0 .5rem 1.25rem rgba(15,23,42,.08) !important;
    }

.alert {
    border-radius: 14px;
}

.dropdown-menu {
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.06);
}

footer {
    margin-top: auto;
}

.footer-logo {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
}

.social-links a {
    transition: all .3s ease;
    display: inline-block;
}

    .social-links a:hover {
        transform: translateY(-5px);
        color: var(--primary-color) !important;
    }

/* ============================================================
   15) LOGIN SECTION
   ============================================================ */
.login-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: rgba(0,102,204,.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   16) AREA SOCIO - DOCUMENTI / FOTO
   ============================================================ */
.foto-thumb {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #fff;
}

.foto-thumb-admin {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fff;
}

.doc-frame {
    width: 100%;
    height: 700px;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.doc-img {
    border-radius: 12px;
    border: 1px solid #ddd;
}

.doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #f8f9fa;
    border-radius: 1rem;
}

.doc-left {
    min-width: 0;
    flex: 1 1 auto;
}

.doc-title {
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.doc-meta {
    font-size: .85rem;
    color: #6c757d;
    margin-top: .15rem;
}

.doc-actions {
    display: inline-flex;
    gap: .35rem;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.doc-ok {
    color: #198754;
    font-weight: 700;
}

.doc-missing {
    color: #dc3545;
    font-weight: 700;
}

.icon-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.upload-icon {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

    .upload-icon input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

.quick-icon {
    width: 80px;
    height: 80px;
    background: rgba(0,102,204,.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
}

/* ============================================================
   17) CROP MODAL SOCIO
   ============================================================ */
#cropModal .modal-content {
    background: #fff !important;
    opacity: 1 !important;
    border: 0;
    border-radius: 14px;
}

#cropModal .modal-body {
    padding: 12px 14px 10px 14px;
}

@media (min-width:992px) {
    #cropModal .modal-dialog.modal-sm {
        max-width: 420px;
    }
}

#cropModal .crop-stage {
    width: 100%;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    border: 1px solid #e6e6e6;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropModal #cropImage {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

#cropModal .crop-controls {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    background: #fff;
}

#cropModal .crop-controls-title {
    font-weight: 700;
    margin-bottom: 8px;
}

#cropModal .crop-zoom {
    display: flex;
    gap: 10px;
}

#cropModal .crop-btn {
    flex: 1 1 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cfd6df;
    background: #fff;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.1;
}

    #cropModal .crop-btn:hover {
        background: #f6f7f9;
    }

#cropModal .crop-arrows {
    margin-top: 10px;
    display: grid;
    justify-items: center;
    gap: 8px;
}

#cropModal .crop-arrows-mid {
    display: flex;
    gap: 10px;
}

#cropModal .crop-icon-btn {
    width: 40px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #cfd6df;
    background: #fff;
}

    #cropModal .crop-icon-btn:hover {
        background: #f6f7f9;
    }

#cropModal .crop-hint {
    margin-top: 10px;
    font-size: .85rem;
    color: #6c757d;
    text-align: center;
}

#cropModal .modal-footer {
    justify-content: center !important;
    gap: 12px;
}

    #cropModal .modal-footer .btn {
        padding: 8px 14px;
        font-size: .9rem;
        border-radius: 999px;
    }

#cropModal .cropper-bg {
    background: #fff !important;
}

#cropModal .cropper-modal {
    opacity: 0 !important;
    background-color: transparent !important;
}

#cropModal .cropper-container {
    background: #fff !important;
}

/* ============================================================
   18) CROP MODAL ATLETA
   ============================================================ */
#cropModalAtleta .modal-content {
    background: #fff !important;
    opacity: 1 !important;
    border: 0;
    border-radius: 14px;
}

#cropModalAtleta .modal-body {
    padding: 12px 14px 10px 14px;
}

@media (min-width:992px) {
    #cropModalAtleta .modal-dialog.modal-sm {
        max-width: 420px;
    }
}

#cropModalAtleta .crop-stage {
    width: 100%;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    border: 1px solid #e6e6e6;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropModalAtleta #cropImageAtleta {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

#cropModalAtleta .crop-controls {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    background: #fff;
}

#cropModalAtleta .crop-controls-title {
    font-weight: 700;
    margin-bottom: 8px;
}

#cropModalAtleta .crop-zoom {
    display: flex;
    gap: 10px;
}

#cropModalAtleta .crop-btn {
    flex: 1 1 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cfd6df;
    background: #fff;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.1;
}

    #cropModalAtleta .crop-btn:hover {
        background: #f6f7f9;
    }

#cropModalAtleta .crop-arrows {
    margin-top: 10px;
    display: grid;
    justify-items: center;
    gap: 8px;
}

#cropModalAtleta .crop-arrows-mid {
    display: flex;
    gap: 10px;
}

#cropModalAtleta .crop-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #cfd6df;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    #cropModalAtleta .crop-icon-btn:hover {
        background: #f6f7f9;
    }

#cropModalAtleta .crop-hint {
    margin-top: 8px;
    text-align: center;
    color: #6c757d;
    font-size: .85rem;
}

/* ============================================================
   19) UTILITY
   ============================================================ */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

    .section-title::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 3px;
        background: var(--primary-color);
    }

/* ============================================================
   20) RESPONSIVE EXTRA
   ============================================================ */
@media (max-width:768px) {
    .hero-section {
        min-height: 500px;
    }

    .hero-content {
        padding: 40px 15px 120px 15px;
    }

        .hero-content h1 {
            font-size: 2.5rem;
        }
}

@media (max-width:576px) {
    .hero-section {
        min-height: 450px;
    }

    #cropModal #cropImage,
    #cropModalAtleta #cropImageAtleta {
        max-height: 260px;
    }
}
