@import 'variables.css';

/* Font Definitions */
@font-face {
    font-family: 'blackoutregular';
    src: url('../font/blackout-webfont.woff2') format('woff2'),
         url('../font/blackout-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

.font-blackout {
	font-family: 'blackoutregular';
}

/* Layout & Containers */
#content {
    padding: 1rem; /* Reduced padding */
    max-width: 100%; /* Use full width */
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Legacy Calendar Container - Kept for backward compatibility but styled with variables */
#calendar {
	margin: 0; 
	box-shadow: var(--shadow-card);
	padding: 0.5rem;
	border-radius: var(--border-radius-card);
	background-color: var(--white);
    max-width: 100%; 
    height: 100%; /* Fill parent */
    overflow: hidden; 
}

/* Utility Classes */
.floatr { float: right; }
.width-150 { width: 150px; }
.margin-bottom-10 { margin-bottom: 10px; }
.noborder { border: none; background: none; }
.elimina-btn { color: var(--error-color); border: none; background: none; }
.btn { white-space: nowrap; } /* Prevent button text wrapping */

.section-title {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.25rem;
}

/* DataTables Customization */
table.dataTable thead th {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Chart Containers */
#dashboard_admin {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

#grafico_giorno, #grafico_mese, #grafico_anno {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-card);
}

/* FullCalendar Customization - ENHANCED VISUALS */

/* 1. Toolbar & Header */
.fc-toolbar-title {
    color: var(--primary-color);
    font-weight: 800; /* Bolder title */
    font-size: 1.5rem !important; /* Adjusted title size */
    letter-spacing: -0.025em;
}

.fc-button-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    font-weight: 600;
    padding: 0.4em 0.8em !important; /* Adjusted buttons */
    text-transform: capitalize;
}

.fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.fc-col-header-cell-cushion {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 0 !important;
    text-decoration: none !important;
}

.fc-col-header-cell {
    background-color: #f1f5f9; /* Light gray header background */
}

/* 2. Grid & Slots */
.fc-timegrid-slot {
    height: 60px !important; /* Increased height for better readability (was 30px) */
    border-bottom: 1px solid #e2e8f0 !important;
}

.fc-timegrid-slot-label-cushion {
    font-size: 1rem; /* Larger time labels */
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.fc-timegrid-axis-cushion {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Hover Effect (Enhanced) */
.fc-timegrid-slot-lane:hover {
    background-color: rgba(99, 102, 241, 0.1) !important; /* Primary color hint */
    cursor: pointer;
    transition: background-color 0.2s;
}

.fc-daygrid-day:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
    cursor: pointer;
}

/* 3. Events */
.fc-event {
    border: none !important;
    border-radius: 6px !important; /* Slightly more rounded */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; /* Deeper shadow */
    font-size: 0.95rem !important; /* Larger font */
    padding: 2px 4px;
    transition: transform 0.1s ease-in-out;
}

.fc-event:hover {
    transform: scale(1.01);
    z-index: 5;
}

.fc-event-main {
    padding: 4px; /* More padding inside event */
    font-weight: 500;
    line-height: 1.4;
}

.fc-event-time {
    font-weight: 700;
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 2px;
    display: block; /* Force time to own line if needed */
}

.fc-event-title {
    font-weight: 600;
    font-size: 1em;
}

/* 4. Current Time Indicator */
.fc-now-indicator-line {
    border-color: var(--error-color) !important;
    border-width: 2px !important;
}

.fc-now-indicator-arrow {
    border-color: var(--error-color) !important;
    border-width: 6px !important;
}

/* 5. Today Highlight */
.fc-day-today {
    background-color: rgba(255, 255, 255, 0.5) !important; /* Keep it subtle if using background color */
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Mobile Optimization */
@media (max-width: 768px) {
    .fc-header-toolbar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .fc-toolbar-title {
        font-size: 1.2rem !important;
        text-align: center;
    }

    .fc-button {
        padding: 4px 8px !important; /* Smaller buttons */
        font-size: 0.8rem !important;
    }
    
    /* Hide some views on very small screens if needed, or adjust */
    .fc-view-harness {
        margin-top: 10px;
    }
    
    /* Better column headers for mobile */
    .fc-col-header-cell-cushion {
        font-size: 0.8rem !important; /* Smaller font */
        padding: 4px 0 !important;
        word-wrap: break-word; /* Allow wrapping */
        white-space: normal !important;
    }
    
    /* Adjust grid for better space usage */
    .fc-timegrid-axis {
        width: 40px !important; /* Smaller time axis */
    }
    
    .fc-timegrid-slot-label {
        font-size: 0.75rem;
    }
}

/* =========================================
   NEW UI/UX ENHANCEMENTS (CLIENT LIST)
   ========================================= */

/* Avatar Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Avatar Colors (Pastel BG + Darker Text) */
.avatar-color-1 { background-color: #e0f2fe; color: #0369a1; } /* Sky */
.avatar-color-2 { background-color: #dcfce7; color: #15803d; } /* Green */
.avatar-color-3 { background-color: #fee2e2; color: #b91c1c; } /* Red */
.avatar-color-4 { background-color: #fef3c7; color: #b45309; } /* Amber */
.avatar-color-5 { background-color: #e0e7ff; color: #4338ca; } /* Indigo */
.avatar-color-6 { background-color: #f3e8ff; color: #7e22ce; } /* Purple */
.avatar-color-7 { background-color: #f1f5f9; color: #334155; } /* Slate */

/* Table Customization */
.table-hover-custom tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e2e8f0; /* Visible separator */
}

/* Zebra Striping for better readability - STRONGER CONTRAST */
.table-hover-custom tbody tr:nth-of-type(odd) {
    background-color: #e2e8f0; /* Slate-200: Much clearer distinction */
}
.table-hover-custom tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}

/* Enhanced Hover State - BOLDER INTERACTION */
.table-hover-custom tbody tr:hover {
    background-color: #cbd5e1 !important; /* Slate-300: Very distinct hover */
    /* transform: scale(1.01); REMOVED to prevent overflow/scroll */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Reduced shadow */
    z-index: 10;
    position: relative;
    border-left: 4px solid var(--primary-color); /* Visual anchor on left */
}

/* GLOBAL OVERFLOW FIX */
body, html {
    overflow-x: hidden;
    max-width: 100vw;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* SCROLLABLE HISTORY TABLE */
.table-history-scrollable {
    max-height: 750px; /* Approximate height of Client Form to prevent page stretching */
    overflow-y: auto;
    border-bottom: 1px solid #e2e8f0;
}

/* Custom Scrollbar for History */
.table-history-scrollable::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.table-history-scrollable::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.table-history-scrollable::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.table-history-scrollable::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

@media screen and (max-width: 992px) {
    /* On mobile/tablet where columns stack, reduce max-height to avoid blocking view */
    .table-history-scrollable {
        max-height: 400px;
    }
}


.table td {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    vertical-align: middle;
    border-bottom-width: 0; /* Let row handle border */
}

/* Dropdown Customization */
.dropdown-item {
    font-size: 0.9rem;
    border-radius: 4px;
    margin: 2px 0;
}
.dropdown-item:hover {
    background-color: #f1f5f9;
}
.dropdown-menu {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Clean up DataTables defaults */
table.dataTable.no-footer {
    border-bottom: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 50%;
}

/* MOBILE TABLE CARD VIEW */
@media screen and (max-width: 768px) {
    /* Force table to not be like tables anymore */
    .table-hover-custom, 
    .table-hover-custom thead, 
    .table-hover-custom tbody, 
    .table-hover-custom th, 
    .table-hover-custom td, 
    .table-hover-custom tr { 
        display: block; 
    }
    
    /* Hide Table Headers */
    .table-hover-custom thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* Card Style for Rows */
    .table-hover-custom tbody tr { 
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        background: #fff;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        position: relative;
    }
    
    /* Adjust Cells */
    .table-hover-custom td { 
        /* Behave  like a "row" */
        border: none;
        border-bottom: 1px solid #f1f5f9; 
        position: relative;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: left;
    }
    
    .table-hover-custom td:last-child { 
        border-bottom: 0; 
        text-align: center;
        padding-top: 1rem !important;
    }
    
    /* Reset Zebra Striping for Cards */
    .table-hover-custom tbody tr:nth-of-type(odd) {
        background-color: #fff; /* Keep cards white */
    }
    
    /* Adjust Hover for Cards */
    .table-hover-custom tbody tr:hover {
        transform: none;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border-left: none; /* Remove left border on mobile */
        border: 1px solid var(--primary-color); /* Full border instead */
    }

    /* Specific Column Tweaks for Mobile */
    
    /* Name/Avatar Column */
    .table-hover-custom td:nth-child(1) {
        font-size: 1.1rem;
        border-bottom: 2px solid #f8fafc;
    }
    
    /* Actions Column - make buttons full width or centered */
    .table-hover-custom td:last-child .dropdown {
        display: block;
        width: 100%;
    }
    
    .table-hover-custom td:last-child .dropdown-toggle {
        width: 100%;
        border-radius: 0.5rem;
        background-color: #f8fafc;
    }
}

/* Responsive Height Utility */
@media (min-width: 992px) {
    .h-lg-100 {
        height: 100% !important;
    }
}
