/* ========================================
   USER LAYOUT - Stile Certificato-Energetico.it
   ======================================== */

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

.wrapper {
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Header styles */
.main-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: auto;
    z-index: 800;
    padding: 10px 15px;
    width: 100%;
}

.logo {
    float: left;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primary), var(--primary-700));
    padding: 0 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.logo-mini {
    display: none;
}

.logo-lg img {
    max-height: 30px;
}

.navbar {
    padding: 0.5rem 1rem;
    margin-bottom: 1rem !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.navbar-brand {
    margin-right: 1rem;
}

.nav-link {
    color: var(--gray-800);
}

.nav-link:hover {
    color: var(--color-primary);
}

.navbar-custom-menu {
    margin-left: auto;
    margin-right: 0;
}

.nav.navbar-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown.user-menu {
    margin-left: auto;
}

.dropdown.user-menu a {
    color: #343a40;
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.dropdown.user-menu a:hover {
    background-color: rgba(0,0,0,0.1);
}

.dropdown.user-menu i {
    margin-right: 8px;
    font-size: 16px;
}

.dropdown.user-menu span {
    font-weight: 500;
}

.content {
    padding: 0;
    background-color: var(--gray-50, #fafafa);
    font-family: 'Inter', system-ui, sans-serif;
}

.user-image.initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--primary-700));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary), var(--primary-700));
    color: white;
}

.user-header .float-left {
    float: left;
    margin-right: 15px;
}

.user-header p {
    margin: 0;
    font-size: 14px;
}

.user-header .p_FullName {
    font-size: 16px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.user-header .btn {
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    border: 1px solid var(--color-danger);
}

.user-body {
    padding: 15px;
}

.user-body a {
    color: #333;
    text-decoration: none;
    padding: 10px 0;
    display: block;
    border-bottom: 1px solid #f4f4f4;
}

.user-body a:hover {
    background-color: #f9f9f9;
}

.user-body i {
    margin-right: 8px;
    width: 16px;
}

/* Sidebar styles */
.main-sidebar {
    top: 0;
    left: 0;
    min-height: 100vh;
    width: 250px;
    background: linear-gradient(135deg, var(--primary-50, #e8f5e9) 0%, var(--gray-50, #fafafa) 100%);
    color: var(--gray-900, #212121);
    z-index: 810;
    transition: transform 0.3s ease-in-out;
}

.sidebar {
    padding-top: 20px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #465c71;
    text-align: center;
}

.sidebar-header h3 {
    color: var(--gray-900, #212121);
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.sidebar-menu .header {
    padding: 10px 25px;
    font-size: 12px;
    color: var(--gray-700, #616161);
    background: rgba(0, 0, 0, 0.05);
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-menu li > a {
    padding: 12px 20px;
    display: block;
    color: var(--gray-800, #424242);
    text-decoration: none;
}

.sidebar-menu li > a:hover {
    background-color: rgba(249, 130, 17, 0.15);
    color: var(--color-accent);
}

.sidebar-menu li > a.active {
    background-color: var(--color-accent);
    color: #fff;
}

.sidebar-menu li > a i {
    margin-right: 10px;
}

/* Content Wrapper */
.content-wrapper {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, var(--primary-50, #e8f5e9) 0%, var(--gray-50, #fafafa) 100%);
    padding-top: 65px;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Footer */
.main-footer {
    margin-left: 250px;
    background-color: #fff;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    color: #777;
}

.main-footer .pull-right {
    float: right;
}

.nav-primary {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 15px;
}

.nav-link {
    color: #777;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .main-sidebar {
        transform: translateX(-250px);
    }

    .content-wrapper {
        width: 100%;
    }

    .main-header {
        left: 0;
    }

    .sidebar-open .main-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .content-wrapper {
        margin-left: 250px;
    }

    .main-header .logo {
        display: none;
    }
}

/* Modal styles per cambio password */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    outline: 0;
}

.modal.fade.show {
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal-backdrop.fade.show {
    opacity: 0.5;
}

.modal-dialog {
    position: relative;
    margin: 60px auto;
    max-width: 500px;
    width: 90%;
}

.modal-content {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
    outline: 0;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 21px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-header .close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.form-horizontal .form-group {
    margin-bottom: 20px;
}

.form-horizontal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--gray-900, #212121);
    font-family: 'Inter', system-ui, sans-serif;
}

.form-horizontal .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-horizontal .form-control:focus {
    border-color: var(--color-primary, #4caf50);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: var(--primary-900, #1b5e20);
    background-color: var(--primary-50, #e8f5e9);
    border-color: var(--primary-200, #a5d6a7);
    border-radius: var(--radius, 0.5rem);
}

.alert-danger {
    color: #b71c1c;
    background-color: #ffebee;
    border-color: #ef9a9a;
    border-radius: var(--radius, 0.5rem);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: var(--radius, 0.5rem);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0.3px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-info {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary, #4caf50), var(--primary-700, #388e3c));
    border: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
}

.btn-info:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-700, #388e3c), var(--primary-800, #2e7d32));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:hover {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

.float-right {
    float: right !important;
}

/* Loading spinner */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(359deg);
    }
}

/* Password requirements styles */
.password-requirements {
    margin-top: 10px;
    font-size: 0.9em;
}

.requirement {
    margin: 5px 0;
}

.requirement-valid {
    color: var(--color-primary);
}

.requirement-invalid {
    color: #dc3545;
}

.requirement-neutral {
    color: #6c757d;
}

/* User Layout and Profile Styles */

/* ===== USER LAYOUT STYLES ===== */

/* User Dropdown Navigation */
.user-dropdown-nav {
    padding: 15px;
    border-bottom: 1px solid #465c71;
    margin-bottom: 15px;
}

.user-menu-link {
    color: var(--gray-100);
    text-decoration: none;
    display: block;
    padding: 10px;
}

.user-menu-link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.dropdown-menu li > a:hover {
    background-color: var(--color-accent);
    color: #fff;
}

/* ===== PROFILE PAGE STYLES ===== */

.profile-container {
    min-height: 100vh;
    background-color: #f4f6f9;
    padding: 20px;
}

.profile-user-img {
    width: 100px;
    height: 100px;
    border: 3px solid #d2d6de;
}

.profile-username {
    font-size: 21px;
    margin-top: 5px;
}

.profile-user-info p {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.profile-user-info h6 {
    margin-bottom: 15px;
    color: #333;
}

.social-states {
    margin: 20px 0;
}

.social-states .link {
    color: #555;
    text-decoration: none;
}

.social-states .link:hover {
    color: var(--color-accent);
}

.nav-tabs-custom {
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    border-radius: 3px;
    margin-bottom: 20px;
}

.nav-tabs-custom .nav-tabs {
    margin: 0;
    border-bottom: 0;
}

.nav-tabs-custom .nav-tabs li a {
    color: #444;
    border-radius: 0;
}

.nav-tabs-custom .nav-tabs li a.active {
    background-color: #f4f4f4;
    border-color: #f4f4f4;
    border-bottom-color: #f4f4f4;
}

.tab-content {
    padding: 10px;
}

.ribbon-wrapper {
    position: relative;
}

.ribbon {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 10;
    background: linear-gradient(135deg, var(--color-primary, #4caf50), var(--primary-700, #388e3c));
    color: white;
    padding: 5px 15px;
    border-radius: var(--radius, 0.5rem);
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.ribbon-bookmark {
    background: #6c757d;
}

.ribbon-wrapper-empty {
    position: relative;
    margin-bottom: 20px;
}

.box {
    background: #fff;
    border-radius: var(--radius-lg, 1rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.box:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.box-header {
    border-bottom: 1px solid #f4f4f4;
    padding: 10px 15px;
}

.box-header .box-title {
    font-size: 18px;
    margin: 0;
    line-height: 1.8;
}

.box-body {
    padding: 15px;
}

.box-footer {
    border-top: 1px solid #f4f4f4;
    padding: 10px 15px;
    background-color: #f9f9f9;
}

.box-profile {
    text-align: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-indicator {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.switch-indicator:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.switch input:checked + .switch-indicator {
    background-color: var(--color-accent);
}

.switch input:checked + .switch-indicator:before {
    transform: translateX(26px);
}

.media {
    display: flex;
    align-items: flex-start;
}

.media-body {
    flex: 1;
}

.toggle-checkbox {
    position: relative;
}

/* ===== UTILITY CLASSES ===== */

.text-uppercase {
    text-transform: uppercase;
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: bold;
}

.text-muted {
    color: #6c757d;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: #dc3545;
}

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

.margin-top-10 {
    margin-top: 10px;
}

.m-b-20 {
    margin-bottom: 20px;
}

.pull-right {
    float: right;
}

.hide {
    display: none;
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-addon {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: #6c757d;
    content: "/";
}

.breadcrumb-item.active {
    color: #6c757d;
}

.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-info {
    color: #01579b;
    background-color: var(--secondary-50, #e3f2fd);
    border-color: var(--secondary-200, #90caf9);
    border-radius: var(--radius, 0.5rem);
}

.alert .icon {
    margin-right: 5px;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .main-sidebar {
        transform: translateX(-250px);
    }
    
    .sidebar-open .main-sidebar {
        transform: translateX(0);
    }
    
    .profile-user-img {
        width: 80px;
        height: 80px;
    }
    
    .profile-username {
        font-size: 18px;
    }
    
    .nav-tabs-custom .nav-tabs li a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .box-body {
        padding: 10px;
    }
    
    .user-dropdown-nav {
        padding: 10px;
    }
    
    .user-menu-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .profile-container {
        padding: 10px;
    }
    
    .nav-tabs-custom {
        margin-bottom: 15px;
    }
    
    .tab-content {
        padding: 8px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Fix per il modal backdrop */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Fix per i badge */
.badge {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Stili per il button arancione */
.btn-outline-orange {
    color: #fff !important;
    background-color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
}

.btn-outline-orange:hover,
.btn-outline-orange:focus,
.btn-outline-orange:active,
.show > .btn-outline-orange.dropdown-toggle {
    color: #fff;
    background-color: var(--accent-dark, #f57c00) !important;
    border-color: var(--accent-dark, #f57c00) !important;
}

/* Badge con tema arancione */
.badge.bg-primary,
.badge.bg-warning,
.badge.bg-info {
    background-color: var(--color-accent) !important;
}

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

/* ===== Override per layout a tutto schermo senza sidebar ===== */
.wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

.content-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.main-header {
    left: 0 !important;
    width: 100% !important;
}

.content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
