/* Stili personalizzati per il Portale Proxmox */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --header-height: 60px;
}

/* Layout principale */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-header .navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.main-header .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    transition: color 0.3s ease;
}

.main-header .navbar-nav .nav-link:hover {
    color: white !important;
}

/* Sidebar */
.main-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.3s ease;
}

.main-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content area */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.content-wrapper.expanded {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Statistiche dashboard */
.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    color: white;
    margin-bottom: 20px;
}

.stats-card.primary { background: linear-gradient(135deg, var(--primary-color), #0056b3); }
.stats-card.success { background: linear-gradient(135deg, var(--success-color), #1e7e34); }
.stats-card.warning { background: linear-gradient(135deg, var(--warning-color), #e0a800); }
.stats-card.danger { background: linear-gradient(135deg, var(--danger-color), #bd2130); }

.stats-card h3 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* Tabelle */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Status badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running { background: var(--success-color); color: white; }
.status-stopped { background: var(--danger-color); color: white; }
.status-paused { background: var(--warning-color); color: white; }
.status-unknown { background: var(--secondary-color); color: white; }

/* Bottoni */
.btn {
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 25px 0 0 25px;
}

.btn-group .btn:last-child {
    border-radius: 0 25px 25px 0;
}

/* Modali */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

/* Form controls */
.form-control {
    border-radius: 25px;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Console VNC */
.vnc-container {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.vnc-toolbar {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

/* Responsive */
@media (max-width: 1200px) {
    .content-wrapper {
        padding: 15px;
    }
    
    .stats-card h3 {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .main-sidebar {
        transform: translateX(-100%);
        z-index: 1040;
    }
    
    .main-sidebar.show {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
        padding: 15px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    /* Mobile-friendly tables */
    .table-responsive {
        border-radius: 10px;
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 8px;
        white-space: nowrap;
    }
    
    /* Improved button groups for mobile */
    .btn-group-sm .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-lg {
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 768px) {
    /* Header adjustments */
    .main-header .navbar-brand {
        font-size: 1.2rem;
    }
    
    .main-header .navbar-nav .nav-link {
        padding: 8px 12px;
    }
    
    /* Sidebar improvements */
    .main-sidebar {
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .sidebar-menu a {
        padding: 18px 20px;
        font-size: 1.1rem;
    }
    
    .sidebar-menu a i {
        margin-right: 15px;
        width: 25px;
    }
    
    /* Content adjustments */
    .content-wrapper {
        padding: 10px;
    }
    
    /* Statistics cards - stack vertically */
    .stats-card {
        margin-bottom: 15px;
        padding: 25px 20px;
    }
    
    .stats-card h3 {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .stats-card p {
        font-size: 1rem;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 15px;
        border-radius: 15px;
    }
    
    .card-header {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    /* Button improvements */
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly minimum */
    }
    
    .btn-sm {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 36px;
    }
    
    /* Form improvements */
    .form-control {
        padding: 15px 20px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    /* Table responsive improvements */
    .table-responsive {
        border-radius: 15px;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
        min-width: 100px;
    }
    
    /* Status badges */
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 15px;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 5px;
    }
    
    .modal-content {
        border-radius: 20px;
    }
    
    .modal-header {
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 20px;
    }
    
    /* VNC Console mobile */
    .vnc-toolbar {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .vnc-toolbar .btn-group {
        margin-bottom: 10px;
    }
    
    .vnc-toolbar .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Virtual keyboard */
    .virtual-keyboard {
        padding: 15px;
    }
    
    .virtual-keyboard .key {
        min-height: 44px;
        min-width: 44px;
        margin: 2px;
        font-size: 0.9rem;
    }
    
    /* Quick actions grid */
    .row [class*="col-"] {
        margin-bottom: 15px;
    }
    
    /* Alert improvements */
    .alert {
        border-radius: 15px;
        padding: 20px;
        font-size: 1rem;
    }
    
    /* Loading spinner */
    .loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 3px;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    .container-fluid {
        padding: 0 10px;
    }
    
    /* Header */
    .main-header {
        height: 50px;
    }
    
    .main-header .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Sidebar */
    .main-sidebar {
        width: 100vw;
        top: 50px;
        height: calc(100vh - 50px);
    }
    
    .content-wrapper {
        margin-top: 50px;
        padding: 8px;
    }
    
    /* Statistics cards */
    .stats-card {
        padding: 20px 15px;
        text-align: center;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .stats-card i {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }
    
    /* Cards */
    .card {
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 20px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-group .btn {
        border-radius: 0;
    }
    
    .btn-group .btn:first-child {
        border-radius: 20px 0 0 20px;
    }
    
    .btn-group .btn:last-child {
        border-radius: 0 20px 20px 0;
    }
    
    /* Forms */
    .form-control {
        padding: 12px 16px;
        border-radius: 20px;
        font-size: 1rem;
    }
    
    .form-floating label {
        padding: 12px 16px;
    }
    
    /* Tables - stack on very small screens */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        min-width: 80px;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0;
        height: 100vh;
        max-width: 100vw;
    }
    
    .modal-content {
        height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        border-radius: 0;
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 15px;
    }
    
    /* VNC Console mobile optimizations */
    .vnc-toolbar {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .vnc-toolbar .btn-group {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .vnc-toolbar .btn {
        flex: 1;
        padding: 12px 8px;
        font-size: 0.8rem;
    }
    
    .vnc-screen {
        height: calc(100vh - 200px) !important;
    }
    
    /* Virtual keyboard mobile */
    .virtual-keyboard {
        padding: 10px;
        background: rgba(0,0,0,0.9);
    }
    
    .keyboard-row {
        display: flex;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .virtual-keyboard .key {
        min-height: 40px;
        min-width: 40px;
        margin: 1px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    /* Clipboard panel mobile */
    .clipboard-panel {
        padding: 10px;
        background: rgba(0,0,0,0.9);
    }
    
    .clipboard-panel textarea {
        border-radius: 10px;
        font-size: 0.9rem;
    }
    
    /* Navigation improvements */
    .pagination {
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 10px 15px;
        margin: 0 2px;
        border-radius: 8px;
    }
    
    /* Search and filters */
    .input-group .form-control {
        border-radius: 20px 0 0 20px;
    }
    
    .input-group .input-group-text {
        border-radius: 0 20px 20px 0;
        padding: 12px 16px;
    }
    
    /* Dropdown improvements */
    .dropdown-menu {
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border: none;
        padding: 10px 0;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .dropdown-item:hover {
        background-color: rgba(0,123,255,0.1);
        border-radius: 0;
    }
}

/* Touch-specific optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .table tbody tr:hover {
        background-color: transparent;
    }
    
    .table tbody tr:active {
        background-color: rgba(0,123,255,0.1);
    }
    
    /* Larger touch targets */
    .sidebar-menu a {
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    .btn-group .btn {
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .sidebar-menu a:hover {
        transform: none;
    }
    
    .sidebar-menu a:active {
        background-color: var(--primary-color);
        color: white;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .main-header {
        height: 45px;
    }
    
    .content-wrapper {
        margin-top: 45px;
    }
    
    .main-sidebar {
        top: 45px;
        height: calc(100vh - 45px);
    }
    
    .stats-card {
        padding: 15px;
    }
    
    .stats-card h3 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .stats-card i {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    
    .vnc-screen {
        height: calc(100vh - 150px) !important;
    }
}

/* Print styles */
@media print {
    .main-header,
    .main-sidebar,
    .btn,
    .modal,
    .vnc-container {
        display: none !important;
    }
    
    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .table {
        font-size: 12px;
    }
    
    .stats-card {
        border: 1px solid #ddd;
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .form-control {
        border: 2px solid #000;
    }
    
    .status-badge {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
        border: 3px solid #ccc;
        border-top-color: var(--primary-color);
    }
}

/* Assign VM Modal Styles */
.assign-step {
    min-height: 400px;
}

.assign-step h6 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

#available-vms-table {
    font-size: 0.875rem;
}

#available-vms-table th {
    background-color: var(--dark-color) !important;
    color: white;
    font-weight: 600;
    border: none;
}

#available-vms-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.vm-checkbox {
    transform: scale(1.2);
}

.progress {
    background-color: #e9ecef;
    border-radius: 10px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.assign-step .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.assign-step .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.assign-step .form-check-label {
    font-weight: 500;
    cursor: pointer;
}

.assign-step .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.assign-step .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.assign-step .alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.assign-step .alert-info {
    background-color: #e7f3ff;
    color: #0c5460;
}

.assign-step .table-responsive {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.assign-step .sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Modal enhancements for assign VM */
.modal-xl .modal-dialog {
    max-width: 1200px;
}

#assignVMModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#assignVMModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

#assignVMModal .modal-header .btn-close {
    filter: invert(1);
}

#assignVMModal .modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Button enhancements for wizard */
#assignVMModal .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#assignVMModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#assignVMModal .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
}

#assignVMModal .btn-success {
    background: linear-gradient(135deg, var(--success-color), #1e7e34);
    border: none;
}

#assignVMModal .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border-color: var(--primary-color);
}

/* Stili per la sezione addon nel popup dettagli abbonamento */
.addon-type-section {
    border-left: 3px solid #dee2e6;
    padding-left: 15px;
    margin-bottom: 20px;
}

.addon-type-section.resource {
    border-left-color: #17a2b8;
}

.addon-type-section.feature {
    border-left-color: #ffc107;
}

.addon-type-section.service {
    border-left-color: #28a745;
}

.addon-card {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.addon-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.addon-card .card-body {
    padding: 12px;
}

.addon-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.addon-card .card-text {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 10px;
}

.addon-card .price-info {
    font-size: 0.85rem;
}

.addon-card .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
}

.modal-xl .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.addons-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.fs-7 {
    font-size: 0.75rem;
}

/* Miglioramenti per il popup dettagli */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.table-sm td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.features-container .badge {
    margin: 2px;
    font-size: 0.8rem;
}

/* Responsive per addon cards */
@media (max-width: 768px) {
    .addon-type-section .col-md-6 {
        margin-bottom: 10px;
    }
    
    .modal-xl .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Stili per il form Nuova Richiesta */
.modal-lg {
    max-width: 900px;
}

.form-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.form-section h6 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 15px;
}

.attachment-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.attachment-item .file-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.attachment-item .file-icon {
    margin-right: 8px;
    color: #007bff;
}

.attachment-item .file-name {
    font-weight: 500;
    margin-right: 8px;
}

.attachment-item .file-size {
    color: #6c757d;
    font-size: 0.875rem;
}

.attachment-item .remove-btn {
    padding: 2px 6px;
    font-size: 0.75rem;
}

.priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-bassa { background-color: #d1ecf1; color: #0c5460; }
.priority-media { background-color: #fff3cd; color: #856404; }
.priority-alta { background-color: #f8d7da; color: #721c24; }
.priority-urgente { background-color: #f5c6cb; color: #721c24; }

.impact-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.impact-basso { background-color: #d4edda; color: #155724; }
.impact-medio { background-color: #fff3cd; color: #856404; }
.impact-alto { background-color: #f8d7da; color: #721c24; }
.impact-critico { background-color: #f5c6cb; color: #721c24; }

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
}

.required-field::after {
    content: " *";
    color: #dc3545;
}

/* Miglioramenti per i select */
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Stili per le checkbox */
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

/* Animazioni per il caricamento allegati */
.attachment-loading {
    opacity: 0.6;
    pointer-events: none;
}

.attachment-success {
    border-color: #28a745;
    background-color: #d4edda;
}

.attachment-error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .form-section {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .attachment-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .attachment-item .remove-btn {
        align-self: flex-end;
        margin-top: 5px;
    }
}

/* Stili per il drag and drop degli allegati */
.file-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.file-drop-zone.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.file-drop-zone i {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.file-drop-zone p {
    margin: 0;
    color: #6c757d;
}

/* Stili per i tooltip informativi */
.info-tooltip {
    cursor: help;
    color: #007bff;
    margin-left: 5px;
}

.info-tooltip:hover {
    color: #0056b3;
}

/* Miglioramenti per la validazione del form */
.is-invalid {
    border-color: #dc3545;
}

.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #28a745;
}

/* Stili per i campi raggruppati */
.field-group {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.field-group-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

/* Stili per i pulsanti del form */
.btn-form-primary {
    background-color: #007bff;
    border-color: #007bff;
    padding: 10px 30px;
    font-weight: 500;
}

.btn-form-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-form-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    padding: 10px 30px;
    font-weight: 500;
}

.btn-form-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* Request Details Modal Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.priority-badge, .status-badge, .category-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Priority badges */
.priority-bassa { 
    background-color: #28a745; 
    color: white;
}
.priority-media { 
    background-color: #ffc107; 
    color: #000;
}
.priority-alta { 
    background-color: #fd7e14; 
    color: white;
}
.priority-urgente { 
    background-color: #dc3545; 
    color: white;
}

/* Status badges */
.status-aperta { 
    background-color: #17a2b8; 
    color: white;
}
.status-in_lavorazione { 
    background-color: #ffc107; 
    color: #000;
}
.status-in_attesa { 
    background-color: #6c757d; 
    color: white;
}
.status-completata { 
    background-color: #28a745; 
    color: white;
}
.status-chiusa { 
    background-color: #343a40; 
    color: white;
}
.status-annullata { 
    background-color: #dc3545; 
    color: white;
}

/* Category badges */
.category-supporto { 
    background-color: #007bff; 
    color: white;
}
.category-tecnico { 
    background-color: #dc3545; 
    color: white;
}
.category-fatturazione { 
    background-color: #28a745; 
    color: white;
}
.category-generale { 
    background-color: #6c757d; 
    color: white;
}
.category-emergenza { 
    background-color: #fd7e14; 
    color: white;
}
.category-hosting { 
    background-color: #20c997; 
    color: white;
}
.category-domini { 
    background-color: #6f42c1; 
    color: white;
}
.category-email { 
    background-color: #e83e8c; 
    color: white;
}
.category-backup { 
    background-color: #fd7e14; 
    color: white;
}
.category-sicurezza { 
    background-color: #dc3545; 
    color: white;
}
.category-manutenzione { 
    background-color: #6c757d; 
    color: white;
}
.category-consulenza { 
    background-color: #17a2b8; 
    color: white;
}
.category-altro { 
    background-color: #6c757d; 
    color: white;
}

/* Request card styles */
.request-card {
    transition: all 0.3s ease;
    border-left: 4px solid #dee2e6;
    border-radius: 0.5rem;
}

.request-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.request-card.priority-urgente {
    border-left-color: #dc3545;
}
.request-card.priority-alta {
    border-left-color: #fd7e14;
}
.request-card.priority-media {
    border-left-color: #ffc107;
}
.request-card.priority-bassa {
    border-left-color: #28a745;
}

/* Tab styles for request details */
.nav-tabs .nav-link {
    border-radius: 0.5rem 0.5rem 0 0;
    border: 1px solid transparent;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Progress bar styles */
.progress {
    height: 0.75rem;
    border-radius: 0.375rem;
}

.progress-bar {
    border-radius: 0.375rem;
}

/* Comment styles */
.comment-item {
    border-left: 3px solid #e9ecef;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment-item.recent {
    border-left-color: #007bff;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Attachment styles */
.attachment-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

/* Checklist styles */
.checklist-item {
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.checklist-item.completed {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.checklist-item .fa-check-circle {
    font-size: 1.25rem;
}

/* Modal enhancements */
.modal-xl {
    max-width: 1200px;
}

.modal-header {
    border-bottom: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-title {
    font-weight: 600;
    color: #495057;
}

/* Card enhancements */
.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .avatar-circle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .priority-badge, .status-badge, .category-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Animation for new comments */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.comment-new {
    animation: slideInRight 0.5s ease-out;
}

/* File type icons colors */
.fa-file-pdf { color: #dc3545; }
.fa-file-word { color: #007bff; }
.fa-file-excel { color: #28a745; }
.fa-file-image { color: #fd7e14; }
.fa-file-archive { color: #6c757d; }
.fa-file-alt { color: #17a2b8; }

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-primary {
    border-left: 4px solid #007bff !important;
}

.border-start-success {
    border-left: 4px solid #28a745 !important;
}

.border-start-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-start-danger {
    border-left: 4px solid #dc3545 !important;
}