/* ============================================
   ALLSEEYINGEYE2 - Modern Restyling
   ============================================ */

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

/* ---- Base & Typography ---- */
body, *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fad):not([class^="pe-7s-"]):not([class*=" pe-7s-"]) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ---- FontAwesome Icon Fix ---- */
.fa, .fas, .far, .fal, .fab, .fad {
    font-family: 'Font Awesome 5 Pro' !important;
}
.fa, .fas {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
}
.fal {
    font-family: 'Font Awesome 5 Pro' !important;
    font-weight: 300 !important;
}
.far {
    font-family: 'Font Awesome 5 Pro' !important;
    font-weight: 400 !important;
}
.fab {
    font-family: 'Font Awesome 5 Brands' !important;
}

h2.title {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: #1a1a2e;
}

h5 {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.9rem;
}

/* ---- Scrollbar personalizzata ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* ---- Dividers ---- */
hr.priceDivider {
    border: 1px dashed #dee2e6;
    margin: 4px 0;
}
hr {
    border-color: rgba(0,0,0,0.08);
}

/* ---- Status Icons ---- */
*.fa-checkError { color: #E74C3C }
*.fa-checkSuccess { color: #2ECC71 }
*.fa-checkWarning { color: #F39C12 }

/* ---- Buttons ---- */
button * { font-weight: 600 !important }
button b.buttonRightIcon { float: left; font-size: 35px; margin: 10px; margin-left: 4px }

button.btn {
    font-size: 13.4px;
    font-weight: 600;
    border-radius: 10px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

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

button.btn:active {
    transform: translateY(0);
}

button.btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

button.btn.btn-primary:hover {
    background: linear-gradient(135deg, #5a72d4 0%, #6a4392 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

button.btn.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

button.btn.btn-success:hover {
    box-shadow: 0 4px 16px rgba(17, 153, 142, 0.4);
}

button.btn.btn-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

button.btn.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border: none;
}

/* ---- Link Widgets ---- */
a.widget-link {
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
    padding-top: 12px;
    margin-top: 8px;
    font-weight: 600;
    color: #667eea;
    transition: color 0.2s;
}
a.widget-link:hover {
    color: #764ba2;
}

div.simpleTable td { font-weight: 600 }

.fa-check-circle { color: #2ECC71 }

/* ---- Header Buttons ---- */
.btn-circle {
    border-radius: 50% !important;
    border: 0;
    padding: 0;
    margin-right: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.btn-circle:hover {
    transform: scale(1.1);
}

.btn-notify {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}

.btn-notify:hover {
    background: rgba(255,255,255,0.25);
}

.btn-notify i {
    font-size: 14px;
    color: #FFF;
}

/* ---- Online Status ---- */
i.onlineStatusIcon { font-size: 9px; }
i.offline { color: #e74c3c }
i.online { color: #2ecc71 }

/* ---- Forms ---- */
form.customForm input, form.customForm select {
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1.5px solid #e0e0e0;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

form.customForm input:focus, form.customForm select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ---- Servizio Buttons ---- */
button#inServizio {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 18px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button#inServizio.onDuty {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(17, 153, 142, 0.35);
    border: none;
}

button#inServizio.offDuty {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.35);
    border: none;
}

button#inServizio:hover {
    transform: scale(1.05);
}

/* ---- Chat Tabs ---- */
div.chatTab {
    background: #FFF;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

div.chatTab:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateX(4px);
}

div.chatTab.selected {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    cursor: initial;
}

div.chatMessage {
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ---- Cards ---- */
.card {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

/* ---- Header ---- */
.app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.widget-heading {
    font-weight: 600;
    font-size: 0.9rem;
}

.widget-subheading {
    font-size: 0.78rem;
    opacity: 0.75;
}

/* Header user info - testo bianco su sfondo scuro */
.app-header .header-user-info .widget-heading {
    color: #fff !important;
}

.app-header .header-user-info .widget-subheading {
    color: rgba(255,255,255,0.7) !important;
}

/* Bottone Esci nell'header */
.app-header #logoutBtn {
    white-space: nowrap;
}

/* ---- Sidebar ---- */
.app-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%) !important;
    border-right: none;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.app-sidebar__inner {
    padding-top: 16px;
}

.scrollbar-sidebar {
    background: transparent !important;
}

.vertical-nav-menu li a {
    color: rgba(255,255,255,0.65) !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 10px 20px 10px 44px !important;
    border-radius: 10px;
    margin: 2px 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.vertical-nav-menu li a:hover {
    color: #fff !important;
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(4px);
}

.vertical-nav-menu li a.mm-active,
.vertical-nav-menu li a.active {
    color: #fff !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.vertical-nav-menu li a .metismenu-icon {
    color: rgba(255,255,255,0.8) !important;
    opacity: 1 !important;
    font-size: 1.1rem !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    text-align: center;
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    margin-top: -14px !important;
    transition: color 0.2s;
}

.vertical-nav-menu li a:hover .metismenu-icon {
    color: #fff !important;
}

.vertical-nav-menu li a.mm-active .metismenu-icon,
.vertical-nav-menu li a.active .metismenu-icon {
    color: #fff !important;
    opacity: 1 !important;
}

.app-sidebar__heading {
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 16px 22px 6px;
}

/* ---- Input Group ---- */
div.input-group {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

div.input-group-text {
    border-radius: 12px 0px 0px 12px;
    border: 0;
    background: #FFF;
}

/* ---- Call Cards (chiamate) ---- */
.callBox .card {
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.callBox .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.callBox .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.callBox .widget-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.callBox img {
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

.callBox .msgBreakBox {
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 6px 0;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
}

.callBox .btn-success {
    border-radius: 12px !important;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* New Badge Animation */
.badge-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-badge 2s infinite;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

@keyframes pulse-badge {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* ---- Time Label ---- */
.callBox label {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(0,0,0,0.45);
}

/* ---- Dashboard Quick Links ---- */
#chiamateHrefBtn, #adminHrefBtn, #chatHrefBtn {
    border: 1.5px solid #e8e8e8 !important;
    border-radius: 14px !important;
    padding: 20px 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

#chiamateHrefBtn:hover, #adminHrefBtn:hover, #chatHrefBtn:hover {
    border-color: #667eea !important;
    background: linear-gradient(135deg, #f5f7ff 0%, #ede9fe 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

#chiamateHrefBtn i, #adminHrefBtn i, #chatHrefBtn i {
    color: #667eea;
    margin-bottom: 8px;
    transition: transform 0.3s;
}

#chiamateHrefBtn:hover i, #adminHrefBtn:hover i, #chatHrefBtn:hover i {
    transform: scale(1.15);
}

/* ---- Chat Interface ---- */
div.chatLeftMessage {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%) !important;
    border-radius: 16px 16px 16px 4px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

div.chatRightMessage {
    background: linear-gradient(135deg, #fde8ea 0%, #f5b7b1 100%) !important;
    border-radius: 16px 16px 4px 16px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

div.chatMessage {
    padding: 12px 14px;
    max-width: 260px;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* ---- Notes ---- */
div.noteBox {
    padding: 8px 12px;
    margin-bottom: 8px;
}

div.noteWrapper {
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    padding: 10px 12px;
    word-break: break-all;
    border: 1px solid rgba(0,0,0,0.06);
    transition: background 0.2s;
}

div.noteWrapper:hover {
    background: rgba(0,0,0,0.07);
}

b.noteInfo {
    font-size: 11px;
    color: #999;
}

/* ---- Modal ---- */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 18px 24px;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 14px 24px;
}

/* ---- Loading Spinner ---- */
.fa-spinner {
    color: #667eea;
}

/* ---- Page Container Animation ---- */
#pageContainer > * {
    animation: fadeInUp 0.4s ease-out;
}

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

/* ---- Responsive fixes ---- */
@media only screen and (max-width: 700px) {
    div.widget-content-left { display: block !important }
    div.app-header__content { padding-right: 16px !important }

    .callBox .card {
        margin-bottom: 12px;
    }

    div.chatMessage {
        max-width: 85%;
    }
}

/* ---- Hamburger ---- */
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    background-color: rgba(255,255,255,0.8) !important;
}

/* ---- App Main ---- */
.app-main__outer {
    background: #f5f6fa;
}

/* ---- Tables ---- */
.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table th {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}
