/* ============================================
   Pannello Amministrazione PA - Custom Styles
   ============================================ */

:root {
    --pa-primary: #0066cc;
    --pa-primary-dark: #0052a3;
    --pa-secondary: #6c757d;
    --pa-light: #f8f9fa;
    --pa-border: #dee2e6;
    --pa-text: #212529;
    --pa-text-muted: #6c757d;
}

/* ============================================
   Pannello Amministrazione PA - Custom Styles
   ============================================ */

:root {
    --pa-primary: #0066cc;
    --pa-primary-dark: #0052a3;
    --pa-secondary: #6c757d;
    --pa-light: #f8f9fa;
    --pa-border: #dee2e6;
    --pa-text: #212529;
    --pa-text-muted: #6c757d;
}

/* ============================================
   Login Page - Dark Mode Modern
   ============================================ */

.login-page {
    background: #0a0e27;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Animated Background */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -150px;
    right: -150px;
    animation-delay: 5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.logo-placeholder {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s ease;
}

.logo-placeholder:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.5;
    filter: blur(20px);
    z-index: -1;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Input Fields */
.input-wrapper {
    position: relative;
}

.input-dark {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 0.875rem 1.25rem !important;
    transition: all 0.3s ease;
}

.input-dark::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.input-dark:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    color: #ffffff !important;
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.input-dark:focus ~ .input-focus-line {
    width: 100%;
}

.btn-dark-toggle {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    transition: all 0.3s ease;
}

.btn-dark-toggle:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.input-group .input-dark {
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
}

/* Modern Button */
.btn-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

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

.btn-content {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-modern:hover .btn-glow {
    width: 300px;
    height: 300px;
}

/* Form Text */
.login-card .form-text {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.875rem;
}

/* ============================================
   Dashboard Page
   ============================================ */

.dashboard-page {
    background-color: #f5f7fa;
}

/* Navbar */
.navbar-brand {
    font-size: 1.25rem;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
}

.navbar .dropdown-item:hover {
    background-color: var(--pa-light);
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    padding-top: 20px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link {
    color: var(--pa-text);
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--pa-primary);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background-color: var(--pa-primary);
    color: white;
}

.sidebar .nav-link.active i {
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
main {
    margin-top: 56px;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-card h2 {
    font-size: 2.5rem;
    color: var(--pa-text);
}

/* Table */
.table {
    font-size: 0.95rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--pa-border);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem;
}

.card-footer {
    border-radius: 0 0 12px 12px !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--pa-primary);
    border-color: var(--pa-primary);
}

.btn-primary:hover {
    background-color: var(--pa-primary-dark);
    border-color: var(--pa-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-outline-primary {
    color: var(--pa-primary);
    border-color: var(--pa-primary);
}

.btn-outline-primary:hover {
    background-color: var(--pa-primary);
    border-color: var(--pa-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 250px;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar.show {
        left: 0;
    }

    main {
        margin-left: 0;
    }

    .stat-card h2 {
        font-size: 2rem;
    }
}

/* Accessibility */
*:focus {
    outline: 2px solid var(--pa-primary);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn {
        display: none;
    }

    main {
        margin: 0;
        padding: 0;
    }
}


/* ============================================
   Dashboard Page
   ============================================ */

.dashboard-page {
    background-color: #f5f7fa;
}

/* Navbar */
.navbar-brand {
    font-size: 1.25rem;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
}

.navbar .dropdown-item:hover {
    background-color: var(--pa-light);
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    padding-top: 20px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link {
    color: var(--pa-text);
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--pa-primary);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background-color: var(--pa-primary);
    color: white;
}

.sidebar .nav-link.active i {
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
main {
    margin-top: 56px;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-card h2 {
    font-size: 2.5rem;
    color: var(--pa-text);
}

/* Table */
.table {
    font-size: 0.95rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--pa-border);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem;
}

.card-footer {
    border-radius: 0 0 12px 12px !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--pa-primary);
    border-color: var(--pa-primary);
}

.btn-primary:hover {
    background-color: var(--pa-primary-dark);
    border-color: var(--pa-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-outline-primary {
    color: var(--pa-primary);
    border-color: var(--pa-primary);
}

.btn-outline-primary:hover {
    background-color: var(--pa-primary);
    border-color: var(--pa-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 250px;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar.show {
        left: 0;
    }

    main {
        margin-left: 0;
    }

    .stat-card h2 {
        font-size: 2rem;
    }
}

/* Accessibility */
*:focus {
    outline: 2px solid var(--pa-primary);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn {
        display: none;
    }

    main {
        margin: 0;
        padding: 0;
    }
}
