/* Custom styles for Admin One Fat-Free Framework */

/* Sidebar Styles */
.aside {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    height: 100vh;
    width: 250px;
    background-color: #2e323a;
    color: #b8beca;
    overflow-y: auto;
    transition: all 0.3s;
}

.aside-tools {
    background-color: #1f2227;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #3e424a;
}

.aside-tools-label {
    color: #fff;
    font-size: 1.25rem;
}

.menu.is-menu-main {
    padding: 1rem;
}

.menu-label {
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.menu-list a {
    color: #b8beca;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.menu-list a:hover {
    background-color: #3e424a;
    color: #fff;
}

.menu-list a.is-active {
    background-color: #3273dc;
    color: #fff;
}

.menu-list a .icon {
    margin-right: 0.5rem;
}

/* Main content area with sidebar offset */
.section.is-main-section,
.section.is-title-bar,
#navbar-main,
footer.footer {
    margin-left: 250px;
}

/* Navbar Styles */
#navbar-main {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 20;
}

.is-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.is-user-name {
    margin: 0 0.5rem;
}

/* Title Bar */
.section.is-title-bar {
    padding: 1rem 1.5rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}

.section.is-title-bar ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.section.is-title-bar ul li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: #b5b5b5;
}

/* Cards */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card-header {
    background-color: #fafafa;
    border-bottom: 1px solid #e8e8e8;
}

/* Widgets */
.is-widget-label .subtitle {
    color: #7a7a7a;
    font-size: 0.875rem;
}

.is-widget-label .title {
    font-size: 2rem;
    font-weight: 700;
}

.has-widget-icon {
    align-items: center;
}

/* Table */
.table {
    background-color: #fff;
}

.table thead th {
    border-color: #dbdbdb;
    color: #363636;
    font-weight: 600;
}

.is-actions-cell {
    white-space: nowrap;
}

.is-image-cell .image {
    width: 40px;
    height: 40px;
}

.is-image-cell img {
    border-radius: 50%;
}

/* Footer */
footer.footer {
    background-color: #fafafa;
    padding: 1.5rem;
    border-top: 1px solid #e8e8e8;
}

/* Responsive */
@media screen and (max-width: 1023px) {
    .aside {
        transform: translateX(-250px);
    }
    
    .aside.is-expanded {
        transform: translateX(0);
    }
    
    .section.is-main-section,
    .section.is-title-bar,
    #navbar-main,
    footer.footer {
        margin-left: 0;
    }
}

/* Chart Area */
.chart-area {
    position: relative;
    height: 400px;
}

/* Progress bars */
.progress.is-small {
    height: 0.5rem;
}

/* Utilities */
.has-text-grey {
    color: #7a7a7a !important;
}

.is-hidden {
    display: none !important;
}

.notification {
    background-color: #fafafa;
    border-radius: 0;
}

/* ============================================
   Notification Container - Centrato in Alto
   ============================================ */

#notification-container {
  position: fixed;
  top: 0;                       /* Attaccato in cima */
  left: 50%;
  transform: translateX(-50%);  /* Centra solo orizzontalmente */
  width: 90%;
  max-width: 800px;             /* Larghezza massima per leggibilità */
  z-index: 1000;                /* Sopra navbar (z-index: 20) */
  pointer-events: none;         /* Permette click attraverso container vuoto */
}

#notification-container .notification {
  margin-bottom: 10px;          /* Spazio tra notifiche multiple */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  pointer-events: auto;         /* Riabilita click sulle notifiche */
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive mobile */
@media screen and (max-width: 768px) {
  #notification-container {
    width: 95%;
    max-width: none;
  }
  
  #notification-container .notification {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#loading-overlay.active {
    opacity: 1;
}

#loading-spinner {
    text-align: center;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3273dc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    color: #363636;
    font-size: 1rem;
    font-weight: 500;
}

/* Button Loading State */
.button.is-loading-custom {
    pointer-events: none;
    opacity: 0.7;
}

.button.is-loading-custom .icon {
    animation: spin 1s linear infinite;
}

