:root {
    --mare-blù: #006994;
    --mare-chiaro: #48CAE4;
    --mare-profondo: #023E8A;
    --sabbia: #F5E6D3;
    --sabbia-oro: #E8D5B7;
    --sabbia-chiaro: #FFF8F0;
    --verde-macchia: #2D6A4F;
    --verde-oceano: #40916C;
    --corallo: #E07A5F;
    --bianco-sardo: #FAFAFA;
    --granito: #4A4A4A;
    --cielo: #90E0EF;
    --bianco-grotta: #F0F8FF;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--bianco-grotta);
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(72, 202, 228, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 105, 148, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 230, 211, 0.3) 0%, transparent 70%);
    min-height: 100vh;
    color: var(--granito);
    line-height: 1.7;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0c1 10 5 15 15 15-10 0-14 5-15 15-1-10-5-15-15-15 10 0 14-5 15-15z' fill='%2348CAE4' fill-opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.navbar {
    background: linear-gradient(135deg, var(--mare-blù) 0%, var(--mare-chiaro) 100%) !important;
    box-shadow: 0 4px 20px rgba(0, 105, 148, 0.3);
    padding: 0.8rem 0;
    border-bottom: 3px solid rgba(255,255,255,0.2);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--corallo), var(--sabbia-oro), var(--mare-chiaro));
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.navbar-brand::before {
    content: '🌊';
    margin-right: 8px;
    font-size: 1.4rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border-radius: 20px;
    margin: 0 3px;
    position: relative;
    overflow: hidden;
}

.navbar-dark .navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--sabbia-oro);
    transition: width 0.3s;
}

.navbar-dark .navbar-nav .nav-link:hover::before {
    width: 60%;
}

.navbar-dark .navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white !important;
}

.navbar-light {
    background: linear-gradient(to right, var(--sabbia), var(--sabbia-oro)) !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 0;
    min-height: 50px;
}

.navbar-light::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mare-chiaro), transparent);
}

.navbar-light .nav-link {
    color: var(--mare-blù) !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    border-radius: 15px;
    position: relative;
}

.navbar-light .nav-link:hover,
.navbar-light .nav-link.fw-bold {
    background: var(--mare-blù);
    color: white !important;
}

.navbar-light .nav-link.fw-bold::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.container {
    max-width: 1200px;
}

.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mare-blù), var(--mare-chiaro), var(--corallo));
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0, 105, 148, 0.2);
}

.card-body {
    padding: 1.8rem;
    position: relative;
}

.card-title {
    color: var(--mare-blù);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    position: relative;
    display: inline-block;
}

.card-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--corallo), var(--mare-chiaro));
    margin-top: 12px;
    border-radius: 2px;
}

.card-text {
    color: #666;
    font-size: 1rem;
}

h1, h2, h3, h4 {
    color: var(--mare-blù);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--mare-blù), var(--mare-profondo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--corallo), var(--mare-chiaro));
    border-radius: 2px;
    -webkit-text-fill-color: initial;
}

.btn {
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--mare-blù), var(--mare-chiaro));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 105, 148, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--mare-chiaro), var(--mare-blù));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 105, 148, 0.5);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--sabbia-oro), var(--sabbia));
    color: var(--mare-blù);
}

.btn-secondary:hover {
    background: var(--sabbia);
    color: var(--verde-macchia);
}

.btn-danger {
    background: var(--corallo);
}

.btn-danger:hover {
    background: #c9634a;
}

.btn-warning {
    background: var(--sabbia-oro);
    color: var(--mare-blù);
}

.btn-warning:hover {
    background: #d4c4a0;
}

.btn-info {
    background: var(--mare-chiaro);
    color: var(--mare-blù);
}

.btn-outline-primary {
    border: 2px solid var(--mare-blù);
    color: var(--mare-blù);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--mare-blù);
    color: white;
}

.form-control, .form-select {
    border-radius: 15px;
    border: 2px solid #e0e0e0;
    padding: 0.8rem 1rem;
    transition: all 0.3s;
    background: #fafafa;
    position: relative;
}

.form-control:focus, .form-select:focus {
    border-color: var(--mare-chiaro);
    box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.2);
    background: white;
}

.form-check-input:checked {
    background-color: var(--mare-blù);
    border-color: var(--mare-blù);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.3);
}

label {
    color: var(--mare-blù);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.table thead {
    background: linear-gradient(135deg, var(--mare-blù), var(--mare-chiaro));
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: all 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(72, 202, 228, 0.1), rgba(245, 230, 211, 0.1));
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.badge {
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-primary {
    background: var(--mare-blù) !important;
}

.badge.bg-info {
    background: var(--mare-chiaro) !important;
    color: var(--mare-blù);
}

.badge.bg-danger {
    background: var(--corallo) !important;
}

.badge.bg-success {
    background: var(--verde-macchia) !important;
}

.badge.bg-secondary {
    background: #888 !important;
}

.alert {
    border-radius: 15px;
    border: none;
    padding: 1rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mare-blù);
    border-radius: 15px 0 0 15px;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: var(--verde-macchia);
}

.alert-info {
    background: linear-gradient(135deg, rgba(72, 202, 228, 0.2), rgba(144, 224, 239, 0.2));
    color: var(--mare-blù);
}

.alert-warning {
    background: linear-gradient(135deg, var(--sabbia-oro), var(--sabbia));
    color: var(--mare-blù);
}

.alert-danger {
    background: linear-gradient(135deg, #fadbd8, #f5b7b1);
    color: var(--corallo);
}

.post-detail {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.post-detail::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(72, 202, 228, 0.1) 0%, transparent 70%);
    border-radius: 0 20px 0 0;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #444;
    position: relative;
    z-index: 1;
}

.post-content img {
    border-radius: 15px;
    margin: 1.5rem 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    max-width: 100%;
    height: auto;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content p:first-of-type::first-letter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--mare-blù);
    float: left;
    line-height: 1;
    margin-right: 10px;
    margin-top: 5px;
}

.post-gallery {
    margin-top: 2rem;
}

.post-gallery h4 {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.post-gallery h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--mare-blù), transparent);
}

.post-gallery .row {
    gap: 10px;
}

.post-gallery .col-6 {
    padding: 5px;
}

.post-gallery img {
    border-radius: 12px;
    transition: all 0.4s;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.post-gallery img:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.youtube-video, .youtube-embed {
    margin-top: 2rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,0.15);
    position: relative;
}

.youtube-video::before, .youtube-embed::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(0, 105, 148, 0.1), transparent);
    border-radius: 20px;
    z-index: -1;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.post-featured-image img {
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.15);
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.post-featured-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.text-muted {
    color: #888 !important;
    font-style: italic;
}

.bg-light {
    background: linear-gradient(to right, var(--sabbia), var(--sabbia-oro)) !important;
}

.border-top, .border-bottom {
    border-color: rgba(0,0,0,0.08) !important;
}

.position-absolute {
    z-index: 10;
}

.rounded-circle {
    box-shadow: 0 4px 15px rgba(0, 105, 148, 0.4);
}

.card-img-top {
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    object-fit: cover;
    height: 200px;
}

img.rounded {
    border-radius: 15px !important;
}

img[style*="max-height: 200px"] {
    object-fit: cover;
    border-radius: 12px;
}

.d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 1rem;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mt-4 {
    margin-top: 2rem !important;
}

.page-content {
    position: relative;
}

.page-content::before {
    content: '🏝️';
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 3rem;
    opacity: 0.1;
    z-index: 0;
}

.page-content::after {
    content: '🌞';
    position: fixed;
    top: 100px;
    right: 20px;
    font-size: 4rem;
    opacity: 0.08;
    z-index: 0;
}

@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand::before {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .card {
        border-radius: 15px;
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .post-detail {
        padding: 1rem;
        border-radius: 15px;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .table {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .btn-sm {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .form-control, .form-select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .hero-section {
        min-height: auto;
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-buttons .btn-lg {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .hero-image {
        flex: none;
        width: 100%;
        margin-top: 1.5rem;
    }

    .image-frame {
        max-width: 200px;
        margin: 0 auto;
    }

    .image-frame img {
        height: 250px !important;
    }

    .section-experiences, .section-contact {
        padding: 2rem 0;
    }

    .contact-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .email-container .col-md-3 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    :root {
        font-size: 13px;
    }

    body {
        line-height: 1.6;
    }

    .navbar-toggler {
        padding: 0.4rem;
    }

    .navbar-light .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .post-gallery .row {
        gap: 5px;
    }

    .post-gallery img {
        height: 100px;
    }

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

    label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn + .btn {
        margin-left: 0;
    }

    .table td, .table th {
        padding: 0.5rem 0.3rem;
    }

    .list-group-item {
        padding: 0.75rem;
    }

    .post-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .img-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .contact-cards {
        flex-direction: column;
        align-items: center;
    }

    .contact-card {
        width: 100%;
        max-width: 280px;
    }

    .wave-divider svg {
        height: 50px;
    }

    .landing-page {
        margin: -0.8rem;
    }

    .hero-section {
        padding: 2rem 0 3rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .image-frame {
        max-width: 160px;
    }

    .image-frame img {
        height: 200px !important;
    }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-img-top {
    transition: transform 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.badge {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

select.form-select, select.form-control {
    cursor: pointer;
}

a {
    color: var(--mare-blù);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--corallo);
}

.list-group-item {
    border-radius: 10px !important;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}

.list-group-item:hover {
    background: rgba(72, 202, 228, 0.1);
    border-color: var(--mare-chiaro);
    transform: translateX(5px);
}

.list-group-item a {
    display: block;
    color: inherit;
}