/* Custom Styles for Partecipazioni Digitali */

/* General */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand img {
    height: 40px;
}

/* Cards */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Stats Cards */
.stats-row .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-row .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.stats-row .card-body {
    min-height: 180px;
}

.stats-row .display-4 {
    font-size: 3rem;
    font-weight: 700;
}

.stats-spacer {
    height: 24px;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
    padding: 20px;
}

.table thead {
    background-color: #f8f9fa;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
}

/* Badges */
.badge {
    font-size: 0.85rem;
    padding: 0.4em 0.8em;
}

/* Buttons */
.btn {
    border-radius: 5px;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 480px;
}

.menu-lingue {
    text-align: right;
    margin-bottom: 20px;
    padding: 10px 0;
}

.menu-lingue a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.menu-lingue a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.menu-lingue a i {
    margin-right: 4px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: slideUp 0.5s ease;
}

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

.logo-login {
    text-align: center;
    margin-bottom: 30px;
}

.logo-login img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748 !important;
    margin-bottom: 8px;
}

.form-label i {
    margin-right: 6px;
    color: #667eea;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #2d3748;
    transition: all 0.3s ease;
    background: #f7fafc;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #a0aec0;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #718096;
}

.form-hint i {
    margin-right: 4px;
}

.recaptcha-container {
    display: flex;
    justify-content: center;
}

.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.btn-login i {
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.link-recovery {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.link-recovery:hover {
    color: #764ba2;
    text-decoration: underline;
}

.link-recovery i {
    margin-right: 6px;
}

.alert-error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #c53030;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.alert-error i {
    margin-right: 10px;
    font-size: 18px;
}

.login-page-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.login-page-footer p {
    margin: 0;
}

/* Alerts */
.alert {
    border-radius: 5px;
}

/* Footer */
footer {
    margin-top: 50px;
    border-top: 1px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .logo-login img {
        max-width: 150px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .menu-lingue {
        text-align: center;
    }
    
    .menu-lingue a {
        margin: 5px;
    }
    
    .card-body .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0 10px;
    }
    
    .login-card {
        padding: 25px 15px;
    }
    
    .btn-login {
        font-size: 15px;
        padding: 12px 20px;
    }
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    box-sizing: border-box;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #2d3748 !important;
    margin-bottom: 8px;
}

.needs-validation .form-control:invalid,
.needs-validation .form-select:invalid {
    border-color: #dc3545;
}

.needs-validation .form-control:valid,
.needs-validation .form-select:valid {
    border-color: #28a745;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #66418a 100%);
}

.btn-warning {
    background-color: #ffc107;
    border: none;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
    color: #000;
}

.btn-danger {
    background-color: #dc3545;
    border: none;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    border: none;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-group .btn {
    margin: 0;
}

/* Badge Styles */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert i {
    margin-right: 8px;
}

/* Card Headers */
.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card-header.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.card-header.bg-info {
    background-color: #17a2b8 !important;
}

/* Table Improvements */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #f1f3f5;
    cursor: pointer;
}

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

/* Border bottom for sections */
.border-bottom {
    border-bottom: 2px solid #e9ecef !important;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Icon spacing */
h2 i, h3 i, h4 i, h5 i {
    margin-right: 10px;
    color: #667eea;
}

.card-header i {
    margin-right: 8px;
}

/* Input groups */
.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #dee2e6;
}

/* Stat card icons */
.stats-row .card i {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    bottom: 20px;
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .alert {
        display: none !important;
    }
}
