﻿/* Custom CSS for GestioneReclami */

body {
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EEF2 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Layout Styles */
.page {
    display: none;
}

    .page.active {
        display: block;
    }

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    /*max-width: 400px;*/
}

.brand-header {
    background: linear-gradient(135deg, #B8C5D1 0%, #A8B5C2 100%);
    color: #4A4A4A;
    border-radius: 10px 10px 0 0;
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, #B8C5D1 0%, #A8B5C2 100%) !important;
}

.navbar-brand, .navbar-nav .nav-link {
    color: #4A4A4A !important;
}

    .navbar-nav .nav-link:hover {
        color: rgba(74, 74, 74, 0.8) !important;
    }

/* Button Styles */
.btn-custom-primary {
    background: linear-gradient(135deg, #B8C5D1 0%, #A8B5C2 100%);
    border: none;
    color: #4A4A4A;
}

    .btn-custom-primary:hover {
        background: linear-gradient(135deg, #A8B5C2 0%, #98A5B2 100%);
        color: #4A4A4A;
    }

/* Content Styles */
.content-wrapper {
    background: #faf9f5;
    min-height: calc(100vh - 56px);
}

/* Table Styles */
.table-hover tbody tr:hover {
    background-color: #F8F9FA !important;
    cursor: pointer;
}

.table tbody tr.table-selected {
    background-color: #F0F2F5 !important;
}

.table tbody tr.table-primary {
    background-color: rgba(184, 197, 209, 0.2) !important;
}

/* Status Badge Styles */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.status-aperto {
    background-color: #fff8e7;
    color: #d97706;
}

.status-in-lavorazione {
    background-color: #F5F7FA;
    color: #B8C5D1;
}

.status-chiuso {
    background-color: #f0fdf4;
    color: #059669;
}

/* Chat Styles */
.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    position: relative;
    word-wrap: break-word;
}

    .message-bubble.user {
        background: linear-gradient(135deg, #B8C5D1 0%, #A8B5C2 100%);
        color: #4A4A4A;
        margin-left: auto;
    }

    .message-bubble.other {
        background: white;
        border: 1px solid #dee2e6;
        margin-right: auto;
    }

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background: white;
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Form Styles */
.form-control:focus {
    border-color: #B8C5D1;
    box-shadow: 0 0 0 0.2rem rgba(184, 197, 209, 0.25);
}

.form-check-input:checked {
    background-color: #B8C5D1;
    border-color: #B8C5D1;
}

.is-invalid {
    border-color: #dc3545;
}

    .is-invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    }

/* Card Styles */
.line-reason-card {
    margin-bottom: 1rem;
    border-left: 4px solid #B8C5D1;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Header Section */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
}

    .header-section h1 {
        white-space: nowrap;
        margin-right: 1rem;
        margin-bottom: 0;
    }

/* Step Container */
.step-container {
    margin-bottom: 2rem;
}

/* Loading Styles */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alert Styles */
.alert {
    border-radius: 0.375rem;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-light {
    background-color: #fefefe;
    border-color: #fdfdfe;
    color: #636464;
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.text-dark {
    color: #212529 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
    }

    .header-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

        .header-section h1 {
            text-align: center;
            margin-right: 0;
        }

    .message-bubble {
        max-width: 85%;
    }

    .chat-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .message-bubble {
        max-width: 90%;
        padding: 0.5rem 0.75rem;
    }
}

/* Animation Styles */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.p-0 {
    padding: 0 !important;
}

.d-grid {
    display: grid !important;
}

.text-center {
    text-align: center !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.nav-submenu {
    border-left: 5px solid #B8C5D1;
}
.border-left-primary {
    border-left: 4px solid #B8C5D1 !important;
}
.messages-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

    .messages-container::-webkit-scrollbar {
        width: 6px;
    }

    .messages-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .messages-container::-webkit-scrollbar-thumb {
        background: #B8C5D1;
        border-radius: 3px;
    }



.message-card, .complaint-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

    .message-card:hover, .complaint-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border-color: #B8C5D1;
    }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.code-order-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.badge-code {
    background: linear-gradient(135deg, #A8C8E1, #98B8D1);
    color: #4A4A4A;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-order {
    background: linear-gradient(135deg, #C8D5B9, #B8C5A9);
    color: #4A4A4A;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.message-datetime {
    text-align: right;
    color: #6c757d;
    font-size: 0.8rem;
}

.sender-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sender-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6c757d, #495057);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
}

.sender-name {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.message-content {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #B8C5D1;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

    .message-content.important {
        background: #FEFDF0;
        border-left-color: #F5E6A3;
    }

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attachment-info {
    color: #F5E6A3;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-view {
    background: linear-gradient(135deg, #A8D8E8, #98C8D8);
    border: none;
    color: #4A4A4A;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

    .btn-view:hover {
        background: linear-gradient(135deg, #98C8D8, #88B8C8);
        color: #4A4A4A;
        transform: translateY(-1px);
    }

.no-messages {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
    font-style: italic;
}

@media (max-width: 576px) {
    .message-header {
        flex-direction: column;
        align-items: stretch;
    }

    .message-datetime {
        text-align: left;
    }

    .code-order-group {
        justify-content: flex-start;
    }
}
/* CSS per Layout Card Reclami */

/* Container principale */
.complaints-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

    .complaints-container::-webkit-scrollbar {
        width: 6px;
    }

    .complaints-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .complaints-container::-webkit-scrollbar-thumb {
        background: #B8C5D1;
        border-radius: 3px;
    }

        .complaints-container::-webkit-scrollbar-thumb:hover {
            background: #A8B5C2;
        }

/* Card base per reclami */
.complaint-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

    .complaint-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border-color: #B8C5D1;
    }

    /* Card con priorità */
    .complaint-card.priority {
        /*  border-left: 4px solid #dc3545;*/
        background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    }

       /* .complaint-card.priority:hover {
            border-left-color: #c82333;
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(220, 53, 69, 0.2);
        }
*/
    /* Layout compatto */
    .complaint-card.compact {
        padding: 0.75rem;
        background: #fafafa;
        border: 1px solid #e0e0e0;
    }

        .complaint-card.compact:hover {
            background: white;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

/* Header del reclamo */
.complaint-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.complaint-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.complaint-date {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Sezione status */
.complaint-status-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #B8C5D1;
}

.status-info {
}

.status-badge {
    /* display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;*/
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

    .status-badge:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .status-badge.compact {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

/* Indicatori di stato */
.urgency-indicator,
.progress-indicator,
.completed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.urgency-indicator {
    background: linear-gradient(135deg, #E8C5C5, #D8B5B5);
    color: #4A4A4A;
    box-shadow: 0 2px 4px rgba(232, 197, 197, 0.3);
}

.progress-indicator {
    background: linear-gradient(135deg, #F5E6A3, #E5D693);
    color: #4A4A4A;
    box-shadow: 0 2px 4px rgba(245, 230, 163, 0.3);
}

.completed-indicator {
    background: linear-gradient(135deg, #C8D5B9, #B8C5A9);
    color: #4A4A4A;
    box-shadow: 0 2px 4px rgba(200, 213, 185, 0.3);
    animation: none;
}

/* Azioni del reclamo */
.complaint-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.complaint-info {
    color: #6c757d;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Badge per codici e ordini */
.code-order-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.badge-code {
    background: linear-gradient(135deg, #A8C8E1, #98B8D1);
    color: #4A4A4A;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(168, 200, 225, 0.3);
    transition: all 0.2s ease;
}

    .badge-code:hover {
        background: linear-gradient(135deg, #98B8D1, #88A8C1);
        transform: translateY(-1px);
    }

.badge-order {
    background: linear-gradient(135deg, #C8D5B9, #B8C5A9);
    color: #4A4A4A;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(200, 213, 185, 0.3);
    transition: all 0.2s ease;
}

    .badge-order:hover {
        background: linear-gradient(135deg, #B8C5A9, #A8B599);
        transform: translateY(-1px);
    }

/* Badge priorità */
.badge-primary {
    background: linear-gradient(135deg, #D0BDF4, #C0ADE4);
    color: #4A4A4A;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(208, 189, 244, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 2px 4px rgba(208, 189, 244, 0.3);
    }

    to {
        box-shadow: 0 4px 8px rgba(208, 189, 244, 0.5);
    }
}

/* Pulsante visualizza */
.btn-view {
    background: linear-gradient(135deg, #A8D8E8, #98C8D8);
    border: none;
    color: #4A4A4A;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 4px rgba(168, 216, 232, 0.3);
}

    .btn-view:hover {
        background: linear-gradient(135deg, #98C8D8, #88B8C8);
        color: #4A4A4A;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(168, 216, 232, 0.4);
    }

    .btn-view:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(168, 216, 232, 0.3);
    }

/* Responsive design */
@media (max-width: 768px) {
    .complaint-header {
        flex-direction: column;
        align-items: stretch;
    }

    .complaint-date {
        text-align: left;
        margin-top: 0.5rem;
    }

    .code-order-group {
        justify-content: flex-start;
        margin-bottom: 0.5rem;
    }

    .complaint-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .btn-view {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .complaint-card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .complaint-status-section {
        padding: 0.5rem;
    }

    .status-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .badge-code,
    .badge-order {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Animazioni aggiuntive */
.complaint-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

    .complaint-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .complaint-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .complaint-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .complaint-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    .complaint-card:nth-child(5) {
        animation-delay: 0.5s;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stati speciali */
.complaint-card[data-status="Chiuso"] {
    opacity: 0.8;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

    .complaint-card[data-status="Chiuso"]:hover {
        opacity: 1;
    }

.complaint-card[data-status="Aperto"] {
    border-left: 3px solid #E8C5C5;
}
