/* Color Theme Override */
:root {
    --primary-color: #2a5298;
    --primary-dark: #1e3c72;
    --primary-light: #7e8ba3;
    --primary-rgb: 42, 82, 152;
}

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Navbar Custom Colors */
.navbar.bg-primary {
    background: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%) !important;
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Bootstrap Primary Color Override */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.5);
}

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

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

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

#app-container {
    padding: 20px;
}

/* Remove padding for landing page */
.landing-page ~ #app-container,
#app-container:has(.landing-page) {
    padding: 0;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1040;
}

/* Login Page */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
}

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

.login-header i {
    font-size: 3rem;
    color: #2a5298;
}

/* Cards */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.info {
    border-left-color: #0dcaf0;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

/* Member/Score Cards */
.item-card {
    transition: all 0.3s;
    border: 1px solid #dee2e6;
}

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

.member-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
}

.member-photo-large {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

/* Badges */
.badge-section {
    font-size: 0.85rem;
}

/* Tables */
.table-hover tbody tr {
    cursor: pointer;
}

/* Buttons */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Forms */
.form-label {
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

/* Image Cropper Modal */
.cropper-container {
    max-height: 400px;
}

/* Calendar */
.fc {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fc-event {
    cursor: pointer;
}

/* Attendance Switch */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

/* Statistics Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Profile Picture Upload */
.profile-picture-upload {
    position: relative;
    display: inline-block;
}

.profile-picture-upload input[type="file"] {
    display: none;
}

.profile-picture-upload label {
    cursor: pointer;
    display: inline-block;
}

.profile-picture-upload:hover .overlay {
    opacity: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
}

/* Search and Filters */
.filter-section {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tags Input */
.tag-item {
    display: inline-block;
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-item .remove-tag {
    cursor: pointer;
    margin-left: 0.5rem;
    color: #dc3545;
}

/* Document List */
.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 10px;
}

.document-item:hover {
    background-color: #f8f9fa;
}

/* Section Files */
.section-file-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Navbar compatta per schermi da 13-17 pollici */
@media (min-width: 1200px) and (max-width: 1650px) {
    .navbar-brand {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }

    .navbar-nav .nav-link {
        font-size: 0.875rem;
        padding: 0.4rem 0.5rem;
    }

    .navbar-nav .nav-link i {
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }

    .navbar-text {
        font-size: 0.8rem;
    }

    .navbar-nav .dropdown-menu {
        font-size: 0.875rem;
    }

    .navbar-nav {
        gap: 0.1rem;
    }

    .navbar-text.me-3 {
        margin-right: 0.5rem !important;
    }

    /* Riduci padding del container */
    .navbar .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (min-width: 1200px) and (max-width: 1440px) {
    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-nav .nav-link {
        font-size: 0.825rem;
        padding: 0.35rem 0.45rem;
    }

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

    .navbar-text {
        font-size: 0.75rem;
    }
}

@media (min-width: 1200px) and (max-width: 1280px) {
    .navbar-brand {
        font-size: 0.9rem;
    }

    .navbar-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.4rem;
    }

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

    .navbar-text {
        font-size: 0.75rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #app-container {
        padding: 10px;
    }

    .stat-card {
        margin-bottom: 15px;
    }

    .member-photo-large {
        width: 80px;
        height: 80px;
    }

    .login-container {
        padding: 10px;
    }
}

/* MFA QR Code */
.qr-code-container {
    text-align: center;
    padding: 20px;
}

.qr-code-container canvas {
    max-width: 256px;
    margin: 0 auto;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: #2a5298;
    background-color: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: #2a5298;
    background-color: #e7f1ff;
}

/* Event Type Colors */
.event-concerto {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.event-prova {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.event-riunione {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.event-altro {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Landing Page Styles */
.landing-page {
    margin: 0;
    padding: 0;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-title i {
    margin-right: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn-hero {
    background: white;
    color: #1e3c72;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: #f8f9fa;
}

.btn-hero i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.btn-hero:hover i {
    transform: translateX(5px);
}

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

/* Floating Notes Animation */
.floating-notes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.note {
    position: absolute;
    font-size: 2rem;
    color: rgba(255,255,255,0.2);
    animation: float 20s infinite ease-in-out;
}

.note-1 {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.note-2 {
    left: 80%;
    top: 40%;
    animation-delay: 2s;
}

.note-3 {
    left: 60%;
    top: 70%;
    animation-delay: 4s;
}

.note-4 {
    left: 30%;
    top: 80%;
    animation-delay: 6s;
}

.note-5 {
    left: 90%;
    top: 15%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(5deg);
    }
    50% {
        transform: translateY(-60px) rotate(-5deg);
    }
    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* Features Section */
.features-section {
    padding: 100px 20px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
}

.feature-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.btn-cta {
    background: white;
    color: #1e3c72;
    border: none;
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: #f8f9fa;
}

.btn-cta i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.btn-cta:hover i {
    transform: translateX(5px);
}

/* Footer */
.landing-footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 30px 20px;
    text-align: center;
}

.landing-footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-section {
        padding: 60px 20px;
    }

    .cta-content h2 {
        font-size: 1.8rem;
    }

    .cta-content p {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .filter-section {
        display: none !important;
    }

    #app-container {
        padding: 0;
    }
}

/* Member Photo Grid Card Hover Effect */
.member-photo-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Member Form Modal with Tabs */
.modal-lg .modal-dialog {
    max-height: 90vh;
    margin: 5vh auto;
    display: flex;
    align-items: center;
}

.modal-lg .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-lg .modal-header {
    flex-shrink: 0;
    border-bottom: 1px solid #dee2e6;
}

.modal-lg .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
}

.modal-lg .modal-footer {
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
}

.modal-xl {
    --bs-modal-width: 1140px;
}

.modal-xl .modal-dialog {
    max-height: 90vh;
    margin: 2.5vh auto;
    display: flex;
    align-items: center;
}

.modal-xl .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-xl .modal-header {
    flex-shrink: 0;
    border-bottom: 1px solid #dee2e6;
}

.modal-xl .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    padding: 0;
}

.modal-xl .modal-footer {
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
}

/* Form inside modal body */
#member-form,
#poll-form,
#communication-form,
#score-form,
#response-modal-body,
#results-modal-body {
    padding: 1rem;
}

/* Tabs sticky at top of form */
#member-form .nav-tabs {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 100;
    margin: -1rem -1rem 1rem -1rem;
    padding: 1rem 1rem 0 1rem;
    border-bottom: 1px solid #dee2e6;
}

#member-form .tab-content {
    min-height: 200px;
}

/* Tab Documenti - rimuovi padding per usare tutta la larghezza */
#content-documenti {
    margin: -1rem -1rem 0 -1rem;
    padding: 1rem 0;
}

#content-documenti h6 {
    padding-left: 1rem;
    padding-right: 1rem;
}

#content-documenti > .btn {
    margin-left: 1rem;
}

#documents-container,
#new-documents-container {
    padding: 0 1rem;
}

#documents-container .card,
#new-documents-container .card {
    width: 100%;
}

#documents-container .card-body,
#new-documents-container .card-body {
    width: 100%;
}
