/* EasyPresence - GD3D-V1 Custom Styles */
/* 3D Cards, Curved Navbar, Responsive Tables, Enhanced UI */

:root {
    --primary-color: #366092;
    --primary-dark: #2c4d78;
    --primary-light: #4a7cb8;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-heavy: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #366092 0%, #4a7cb8 100%);
    --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    line-height: 1.6;
}

/* 3D Card Styles */
.gd3d-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.gd3d-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-medium);
}

.gd3d-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.gd3d-card:hover::before {
    left: 100%;
}

.gd3d-card .card-header {
    border: none;
    border-radius: 15px 15px 0 0;
    position: relative;
    z-index: 2;
}

.gd3d-card .card-body,
.gd3d-card .card-footer {
    position: relative;
    z-index: 2;
}

/* Enhanced Buttons */
.gd3d-button {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(54, 96, 146, 0.3);
}

.gd3d-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.gd3d-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(54, 96, 146, 0.4);
}

.gd3d-button:hover::before {
    left: 100%;
}

.gd3d-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(54, 96, 146, 0.3);
}

/* Curved Navbar */
.gd3d-navbar {
    border-radius: 0 0 25px 25px;
    background: var(--gradient-primary);
    box-shadow: 0 4px 20px var(--shadow-medium);
    position: relative;
    z-index: 1000;
}

.gd3d-navbar::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: var(--gradient-primary);
    border-radius: 0 0 50% 50%;
    opacity: 0.3;
}

.gd3d-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px var(--shadow-light);
}

.gd3d-navbar .nav-link {
    border-radius: 10px;
    margin: 0 5px;
    transition: all 0.3s ease;
    position: relative;
}

.gd3d-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.gd3d-navbar .dropdown-menu {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    margin-top: 10px;
}

.gd3d-navbar .dropdown-item {
    border-radius: 8px;
    margin: 3px 0;
    transition: all 0.2s ease;
}

.gd3d-navbar .dropdown-item:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(5px);
}

/* Responsive Tables (Stack on Mobile) */
@media (max-width: 768px) {
    .table-stack {
        border: 0;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tr {
        border: 1px solid #dee2e6;
        border-radius: 15px;
        margin-bottom: 15px;
        padding: 15px;
        background: white;
        box-shadow: 0 4px 15px var(--shadow-light);
    }

    .table-stack td {
        border: none;
        position: relative;
        padding: 10px 0;
        text-align: left;
    }

    .table-stack td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary-color);
        display: block;
        margin-bottom: 5px;
    }
}


/* Touch-friendly buttons and forms */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    /* Form improvements */
    .form-control, .form-select {
        min-height: 50px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .gd3d-card {
        margin: 0 10px 20px 10px;
        transform: none; /* Disable hover transforms on mobile */
    }
    
    .gd3d-card:hover {
        transform: none;
    }
    
    /* Navigation improvements */
    .navbar-toggler {
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    .navbar-collapse {
        background: rgba(255,255,255,0.98);
        margin-top: 10px;
        border-radius: 15px;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    /* Breadcrumb mobile */
    .breadcrumb {
        flex-wrap: wrap;
        padding: 8px 0;
    }
    
    .breadcrumb-item {
        font-size: 0.9rem;
    }
    
    /* Dashboard grid improvements */
    .row.g-3 > .col-12,
    .row.g-3 > .col-sm-6,
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-lg-3 {
        margin-bottom: 15px;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Compact card layouts */
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* Stack button groups */
    .btn-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 8px;
        border-radius: 8px !important;
    }
    
    .btn-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Table responsive wrapper */
    .table-responsive {
        border-radius: 8px;
        margin-bottom: 20px;
    }
}

/* Enhanced Form Controls */
.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(54, 96, 146, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Progress Bars */
.progress {
    border-radius: 25px;
    background: #e9ecef;
    box-shadow: inset 0 2px 4px var(--shadow-light);
}

.progress-bar {
    border-radius: 25px;
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(54, 96, 146, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 75%, 
        transparent 75%, 
        transparent);
    background-size: 30px 30px;
    animation: progress-shine 1s linear infinite;
}

@keyframes progress-shine {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}

/* Badges and Pills */
.badge {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Badge Colors for Congedi */
.badge-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #8e7ae8 100%);
    color: white;
    border: 1px solid #6f42c1;
}

.badge-indigo {
    background: linear-gradient(135deg, #6610f2 0%, #7e4ae8 100%);
    color: white;
    border: 1px solid #6610f2;
}

.badge-violet {
    background: linear-gradient(135deg, #d63384 0%, #e85ba8 100%);
    color: white;
    border: 1px solid #d63384;
}

/* Calendar Event Classes for Congedi */
.event-congedo {
    border-left: 4px solid #6f42c1;
    background-color: rgba(111, 66, 193, 0.1);
    transition: all 0.3s ease;
}

.event-maternita_obbligatoria {
    border-left-color: #d63384;
    background-color: rgba(214, 51, 132, 0.1);
}

.event-maternita_anticipata {
    border-left-color: #6610f2;
    background-color: rgba(102, 16, 242, 0.1);
}

.event-paternita {
    border-left-color: #6f42c1;
    background-color: rgba(111, 66, 193, 0.1);
}

.event-parentale {
    border-left-color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.1);
}

.event-congedo:hover {
    background-color: rgba(111, 66, 193, 0.2);
    transform: translateX(2px);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -37px;
    top: 0;
    z-index: 2;
}

/* Loading Animations */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Modals */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-heavy);
    overflow: hidden;
}

.modal-header {
    border: none;
    border-radius: 20px 20px 0 0;
    padding: 25px 30px;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    border: none;
    padding: 20px 30px 30px;
}

/* List Groups */
.list-group-item {
    border: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.list-group-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

/* Background Gradients */
.bg-gradient {
    background: var(--gradient-secondary);
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(54,96,146,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stats-card:hover::before {
    opacity: 1;
}

.stats-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.stats-number {
    font-size: 3rem;
    font-weight: 300;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px var(--shadow-light);
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 3px solid rgba(54, 96, 146, 0.5);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .gd3d-card,
    .gd3d-button,
    .stats-card {
        box-shadow: none;
        background: white;
    }
    
    .gd3d-navbar {
        display: none;
    }
    
    .btn {
        border: 1px solid #ccc;
    }
}

/* Dark Mode Support - DISABILITATO per forzare sempre tema chiaro */

/* Responsive Design Enhancements */
@media (max-width: 576px) {
    .gd3d-card {
        border-radius: 10px;
        margin: 10px 5px;
    }
    
    .gd3d-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .stats-card {
        padding: 40px;
    }
}

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

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

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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