@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --border-color: #dee2e6;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --sidebar-width: 260px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism & Cards */
.glass-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-radius: 0.75rem;
}

/* Sidebar & Navigation */
.sidebar {
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
}

.sidebar-collapsed .sidebar {
    display: none;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background-color: #f1f3f5;
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #0d6efd; /* Bootstrap primary blue */
}

/* Mobile specific fixes */
@media (max-width: 767.98px) {
    #content-wrapper {
        padding-bottom: 75px !important; /* Spazio per la barra di navigazione inferiore */
    }
}

/* Gradients */
.bg-gradient-indigo {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

/* Ticket Warning Levels (Age-based row formatting) */
.ticket-row-normal td {
    background-color: #ffffff;
}

.ticket-row-normal:hover td {
    background-color: #f8f9fa !important;
}

.ticket-row-warning-yellow td {
    background-color: #fffbeb !important; /* light yellow */
    border-top-color: #fef3c7 !important;
    border-bottom-color: #fef3c7 !important;
}
.ticket-row-warning-yellow tr td:first-child {
    border-left: 4px solid #f59e0b !important;
}
.ticket-row-warning-yellow:hover td {
    background-color: #fef3c7 !important;
}

.ticket-row-warning-red td {
    background-color: #fef2f2 !important; /* light red */
    border-top-color: #fee2e2 !important;
    border-bottom-color: #fee2e2 !important;
}
.ticket-row-warning-red tr td:first-child {
    border-left: 4px solid #dc3545 !important;
}
.ticket-row-warning-red:hover td {
    background-color: #fee2e2 !important;
}

/* Badge styling */
.badge-custom {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-content {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #e9ecef;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

/* Drag and Drop Upload Zone */
.upload-dropzone {
    border: 2px dashed #0d6efd;
    background-color: rgba(13, 110, 253, 0.02);
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    background-color: rgba(13, 110, 253, 0.06);
    border-color: #0b58ca;
    transform: scale(1.005);
}

.upload-dropzone i {
    transition: transform 0.2s ease-in-out;
}

.upload-dropzone:hover i, .upload-dropzone.dragover i {
    transform: translateY(-4px);
}

/* File list item */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    animation: fadeIn 0.2s ease-out forwards;
    transition: all 0.2s ease;
}

.file-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-item-remove {
    color: #dc3545;
    background: none;
    border: none;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-item-remove:hover {
    background-color: #f8d7da;
    color: #a71d2a;
}

/* WYSIWYG Editor */
.wysiwyg-container {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: #ffffff;
    overflow: hidden;
}
.wysiwyg-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    padding: 0.375rem 0.5rem;
    display: flex;
    gap: 0.25rem;
}
.wysiwyg-toolbar .btn-editor {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.wysiwyg-toolbar .btn-editor:hover {
    background-color: #e9ecef;
    color: var(--text-primary);
}
.wysiwyg-editor {
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    outline: none;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: #ffffff;
}
.wysiwyg-editor:focus {
    background-color: #ffffff;
}
.wysiwyg-editor ul, .wysiwyg-editor ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.wysiwyg-editor p {
    margin-bottom: 0.5rem;
}

/* Expanded WYSIWYG overlay */
.wysiwyg-container.wysiwyg-expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
}
.wysiwyg-container.wysiwyg-expanded .wysiwyg-toolbar {
    border-radius: 0;
    padding: 0.5rem 0.75rem;
}
.wysiwyg-container.wysiwyg-expanded .wysiwyg-editor {
    flex: 1;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: 1rem;
}

/* Reference panel inside expanded editor */
.wysiwyg-reference {
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    flex-shrink: 0;
}
.wysiwyg-reference-body {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wysiwyg-reference-badge {
    display: inline-block;
    background: #0d6efd;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Sticky column styling */
@media (min-width: 992px) {
    .sticky-column {
        position: sticky;
        top: 20px;
        align-self: start;
    }
}

