/* Stili generali per il portale Hammer and Drill Lead */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../img/sfond.png') center center / cover no-repeat fixed,
        linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4caf50 100%);
    background-attachment: fixed;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Navbar personalizzata */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Card personalizzate */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 20px;
    background-color: #ffffff;
    color: #212529;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Bottoni personalizzati */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Statistiche dashboard */
.card.bg-primary,
.card.bg-warning,
.card.bg-success,
.card.bg-danger {
    transition: transform 0.3s;
}

.card.bg-primary:hover,
.card.bg-warning:hover,
.card.bg-success:hover,
.card.bg-danger:hover {
    transform: translateY(-5px);
}

/* Tabelle */
.table {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* Badge personalizzati per gli stati */
.badge-primary {
    background-color: #007bff;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Form */
.form-control {
    color: #495057;
    background-color: #fff;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    color: #495057;
}

label {
    font-weight: 500;
    color: #495057;
}

.form-text {
    color: #6c757d;
}

/* Responsive - Mobile Optimizations */
@media (max-width: 768px) {

    /* Container and spacing */
    .container,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem;
        color: #ffffff;
    }

    h2 {
        font-size: 1.5rem;
        color: #212529;
    }

    h3,
    h4,
    h5,
    h6 {
        color: #212529;
    }

    /* Cards */
    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    /* Dashboard Statistics Cards - Stack vertically */
    .row.mb-4 .col-md-3 {
        margin-bottom: 10px;
    }

    .card.bg-primary,
    .card.bg-warning,
    .card.bg-success,
    .card.bg-danger {
        margin-bottom: 10px;
    }

    /* Tables - Horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    .table {
        min-width: 800px;
        /* Force horizontal scroll for wide tables */
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* Navbar - Mobile optimizations */
    .navbar {
        padding: 0.5rem 1rem;
    }

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

    .navbar-toggler {
        padding: 0.5rem;
        font-size: 1.25rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    .navbar-collapse {
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
        /* Touch-friendly target */
        display: flex;
        align-items: center;
    }

    .navbar-nav .dropdown-menu {
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .navbar-nav .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        /* Touch-friendly target */
        display: flex;
        align-items: center;
    }

    /* Buttons - Touch-friendly */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        min-height: 50px;
        padding: 0.75rem 1.5rem;
        font-size: 1.125rem;
    }

    /* Button groups - Wrap on mobile */
    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        margin-right: 0.25rem;
        margin-bottom: 0.5rem;
    }

    /* Action buttons container */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .d-flex.justify-content-between .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Form controls - Touch-friendly */
    .form-control {
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    .form-control-sm {
        font-size: 14px;
        min-height: 38px;
    }

    select.form-control {
        font-size: 16px;
        min-height: 44px;
    }

    textarea.form-control {
        font-size: 16px;
        min-height: 100px;
    }

    label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    /* Form groups */
    .form-group {
        margin-bottom: 1rem;
    }

    /* Filter panels */
    .card-header .btn-link {
        font-size: 1rem;
        padding: 0.5rem;
        width: 100%;
        text-align: left;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-item {
        margin: 0.125rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-height: 38px;
    }

    /* Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    /* Badges */
    .badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }

    /* Lead details */
    .lead-details {
        padding: 15px;
    }

    /* Comments */
    .comment {
        padding-left: 10px;
        margin-bottom: 10px;
    }

    /* Filter status buttons */
    .filter-status {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
        margin: 0.125rem;
    }

    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.95rem;
        min-width: 250px;
        max-width: 90vw;
    }

    /* Modal dialogs */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 0.5rem;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .container,
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.4rem;
    }

    /* Stack action buttons vertically */
    .text-right .btn,
    .text-center .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Animazioni */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Stili per la pagina di login */
.login-container {
    max-width: 400px;
    width: 100%;
    padding: 15px;
}

/* Stili per la visualizzazione delle lead */
.lead-details {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    color: #212529;
}

.lead-details h2 {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #212529;
}

.lead-info-label {
    font-weight: 600;
    color: #495057;
}

/* Stili per i commenti */
.comment {
    border-left: 3px solid #007bff;
    padding-left: 15px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.comment-body {
    color: #212529;
}

/* Stili per la timeline della cronologia attività */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #007bff, #28a745);
}

.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 25px;
    padding-left: 20px;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    top: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 3px solid #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline-icon i {
    font-size: 14px;
}

.timeline-content {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-left: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f8f9fa;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.timeline-header strong {
    color: #495057;
    font-size: 14px;
}

.timeline-header small {
    font-size: 12px;
    color: #6c757d;
}

.timeline-body {
    color: #212529;
    font-size: 13px;
    line-height: 1.4;
}

/* Colori specifici per i diversi tipi di attività */
.timeline-item .fa-plus-circle {
    color: #28a745;
}

.timeline-item .fa-edit {
    color: #ffc107;
}

.timeline-item .fa-tag {
    color: #17a2b8;
}

.timeline-item .fa-comment {
    color: #007bff;
}

.timeline-item .fa-user-plus {
    color: #6c757d;
}

.timeline-item .fa-history {
    color: #6c757d;
}

/* Responsive per la timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-icon {
        left: -20px;
        width: 30px;
        height: 30px;
    }

    .timeline-icon i {
        font-size: 12px;
    }

    .timeline-content {
        margin-left: 15px;
        padding: 12px;
    }

    .timeline-content::before {
        left: -6px;
        border-right-width: 6px;
    }
}