/* Resource Planner - Stile TechPulse */

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

:root {
    /* Colori TechPulse */
    --primary-color: #0a58ca;
    --primary-hover: #0848a8;
    --secondary-color: #666666;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-color: #F8F8F8;
    --dark-color: #333333;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
    
    /* Ombre e bordi */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.03);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 15px 30px rgba(0, 206, 209, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Moderno */
.modern-header {
    background: #FFFFFF;
    color: var(--text-color);
    padding: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.modern-header .container-fluid {
    padding: 0 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

/* Brand (Logo + Titolo) */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-animated-container-small {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.logo-animated-container-small .logo-animated {
    width: 100%;
    height: 100%;
}

.header-title h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--text-color);
    line-height: 1.2;
}

.header-subtitle {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.1rem;
}

/* Frase motivazionale nell'header */
.header-title .motivational-quote {
    margin-top: 0.3rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.header-title .motivational-quote:hover {
    opacity: 1;
}

.header-title .motivational-quote small {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    display: block;
    max-width: 500px;
}

.header-title .motivational-quote i {
    opacity: 0.6;
    font-size: 0.65rem;
}

/* Navigazione */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--light-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-link-logout {
    color: var(--danger-color);
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.nav-link-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .header-nav {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 0.6rem;
        min-width: 40px;
        justify-content: center;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-title .motivational-quote {
        display: none;
    }
}

/* Immagine Grinch nel banner */
.grinch-banner-image {
    position: absolute;
    right: 20px;
    bottom: 0;
    height: auto;
    max-height: 100%;
    width: auto;
    z-index: 3;
    pointer-events: none;
    transform-origin: bottom right;
}

/* Nascondi l'immagine Grinch su mobile */
@media (max-width: 768px) {
    .grinch-banner-image {
        display: none;
    }
}

/* Controlli Mese */
.month-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.month-controls .btn-group {
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.month-controls .btn {
    border-radius: 0;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.month-controls .btn:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.month-controls .btn:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

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

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    overflow: hidden;
    background: #FFFFFF;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Project Cards */
.project-card {
    cursor: pointer;
    transition: all 0.4s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-card .card-header {
    background: var(--primary-color);
    color: white;
    border: none;
}

/* Commessa Items */
.commessa-item {
    background: #FFFFFF;
    border-left: 4px solid var(--primary-color);
    margin: 0.5rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.commessa-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

/* Calendar */
.calendar-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.calendar-cell {
    min-height: 60px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem;
    background: #FFFFFF;
}

.calendar-cell:hover {
    background-color: var(--light-color);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 206, 209, 0.2);
}

.calendar-cell.incomplete-past-day {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5;
}

.calendar-cell.today-highlight {
    border: 3px solid var(--primary-color) !important;
    background-color: rgba(0, 206, 209, 0.05);
    box-shadow: 0 0 10px rgba(0, 206, 209, 0.4);
    position: relative;
}

.calendar-cell.today-highlight::before {
    content: "OGGI";
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-color);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 5;
}

.today-header {
    background: var(--primary-color) !important;
    color: white !important;
    font-weight: 600 !important;
    position: relative;
}

.today-header::after {
    content: "●";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
    color: white;
}

.project-allocation {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: white;
    text-align: center;
    margin: 0.125rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.project-allocation:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* Allocazioni multiple */
.allocations-container {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.total-hours {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 0.125rem 0.25rem;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.125rem;
    font-weight: 600;
}

/* Stili per le allocazioni esistenti nel modal */
#existingAllocations .card {
    border-left: 4px solid var(--primary-color);
    margin-bottom: 0.5rem;
}

#existingAllocations .card-body {
    padding: 0.75rem;
}

#existingAllocations .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Assicura che il pulsante di eliminazione sia sempre visibile */
#existingAllocations .card .btn,
#existingAllocations .card .btn-outline-danger,
#existingAllocations .d-flex .btn,
#existingAllocations .card-body .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Forza la visibilità anche quando la card non è in hover */
#existingAllocations .card:not(:hover) .btn,
#existingAllocations .card:not(:hover) .btn-outline-danger {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Override di qualsiasi regola che nasconde i pulsanti */
#existingAllocations * .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Forza la visibilità dei pulsanti di azione specifici */
#existingAllocations .card .d-flex .btn-group .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 999 !important;
    width: auto !important;
    height: auto !important;
    min-width: 32px !important;
    min-height: 32px !important;
}

/* Stile per il pulsante di modifica */
#existingAllocations .card .d-flex .btn-group .btn-outline-primary {
    background-color: white !important;
    border-color: #0d6efd !important;
    color: #0d6efd !important;
}

#existingAllocations .card .d-flex .btn-group .btn-outline-primary:hover {
    background-color: #0d6efd !important;
    color: white !important;
}

/* Stile per il pulsante di eliminazione */
#existingAllocations .card .d-flex .btn-group .btn-outline-danger {
    background-color: white !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

#existingAllocations .card .d-flex .btn-group .btn-outline-danger:hover {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Assicura che il pulsante di salvataggio sia sempre visibile durante la modifica */
#saveAllocation {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Stile per il pulsante di modifica */
#saveAllocation.btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: white !important;
}

#saveAllocation.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: white !important;
}

/* Badge cliccabile per consuntivata */
.clickable-badge {
    transition: all 0.2s ease;
    user-select: none;
}

.clickable-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.clickable-badge:active {
    transform: scale(0.95);
}

.day-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.person-header {
    background: var(--light-color);
    font-weight: 600;
    padding: 1rem;
    border: 1px solid var(--border-color);
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 150px;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: 1.5rem 2rem;
}

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

.modal-header .modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border: none;
    padding: 1rem 2rem 2rem 2rem;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 206, 209, 0.25);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 206, 209, 0.4);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 206, 209, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 206, 209, 0.4);
}

.btn-success {
    background: var(--success-color);
    border: none;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    border: none;
    color: white;
}

.btn-info {
    background: var(--info-color);
    border: none;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    border: none;
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

/* Tables */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: var(--border-radius);
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    border-radius: var(--border-radius);
    transition: width 0.6s ease;
}

/* Badges */
.badge {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.alert-danger {
    background: var(--danger-color);
    color: white;
}

.alert-success {
    background: var(--success-color);
    color: white;
}

.alert-warning {
    background: var(--warning-color);
    color: white;
}

.alert-info {
    background: var(--info-color);
    color: white;
}

/* Statistics Cards */
.stat-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: var(--border-radius-lg);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-buttons {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .calendar-cell {
        min-height: 50px;
        font-size: 0.8rem;
    }
    
    .project-allocation {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Logo Animato */
.logo-animated-container {
    display: inline-block;
    margin-bottom: 1rem;
    width: 120px;
    height: 120px;
    position: relative;
}

.logo-animated-container-small {
    position: relative;
}

.logo-animated {
    width: 100%;
    height: 100%;
    display: block;
}

/* Animazione cerchi esterni - entrano dal centro */
.logo-circle-2,
.logo-circle-3,
.logo-circle-4,
.logo-circle-5 {
    transform-origin: 100px 100px;
    opacity: 0;
    animation: circleAppear 1.2s ease-out forwards;
}

.logo-circle-2 {
    animation-delay: 0.1s;
}

.logo-circle-3 {
    animation-delay: 0.2s;
}

.logo-circle-4 {
    animation-delay: 0.3s;
}

.logo-circle-5 {
    animation-delay: 0.4s;
}

/* Animazione cerchio centrale - scala da zero */
.logo-circle-1 {
    transform-origin: 100px 100px;
    transform: scale(0);
    animation: centerCircleAppear 0.8s ease-out 0.5s forwards;
}

/* Animazione linee di connessione */
.logo-line {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    opacity: 0;
    animation: lineDraw 0.6s ease-out forwards;
}

.logo-line-1 {
    animation-delay: 0.6s;
}

.logo-line-2 {
    animation-delay: 0.7s;
}

.logo-line-3 {
    animation-delay: 0.8s;
}

.logo-line-4 {
    animation-delay: 0.9s;
}

/* Keyframes */
@keyframes circleAppear {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
}

@keyframes centerCircleAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lineDraw {
    0% {
        stroke-dashoffset: 20;
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.6;
    }
}

/* Animazione pulsazione continua per il cerchio centrale */
.logo-circle-1 {
    animation: centerCircleAppear 0.8s ease-out 0.5s forwards,
               pulse 2s ease-in-out 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Stile testo logo */
.logo-text {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Logo piccolo per header */
.logo-animated-container-small .logo-circle-1 {
    animation: centerCircleAppear 0.8s ease-out 0.5s forwards,
               pulse 2s ease-in-out 1.5s infinite;
}

.logo-animated-container-small .logo-circle-2,
.logo-animated-container-small .logo-circle-3,
.logo-animated-container-small .logo-circle-4,
.logo-animated-container-small .logo-circle-5 {
    animation: circleAppear 1.2s ease-out forwards;
}

.logo-animated-container-small .logo-line {
    animation: lineDraw 0.6s ease-out forwards;
}
