/* GreenWorld SRL Style - Based on greenworldsrl.com */

:root {
    --primary: #1b9643;
    --primary-dark: #0e7533;
    --primary-light: #41b968;
    --secondary: #3c4043;
    --light: #f8f9fa;
    --dark: #191c1e;
    --gray: #757575;
    --light-gray: #e0e0e0;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

/* Global Styles */
body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--secondary);
    background-color: #f5f5f5;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1rem;
}

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

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

/* Buttons */
.btn {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s;
}

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

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

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

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

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

/* Layout */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 40px;
}

.navbar-nav .nav-item .nav-link {
    color: var(--secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-item .nav-link i {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.navbar-nav .nav-item.active .nav-link {
    color: var(--primary);
}

.sidebar {
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 56px);
}

.sidebar-heading {
    font-size: 1.2rem;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--secondary);
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background-color: rgba(27, 150, 67, 0.1);
    border-left-color: var(--primary);
    color: var(--primary);
}

.sidebar-menu li a i {
    margin-right: 0.5rem;
}

.content {
    padding: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.card-footer {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 200px;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.table th {
    font-weight: 600;
    border-top: none;
    background-color: rgba(27, 150, 67, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(27, 150, 67, 0.03);
}

/* File Browser */
.file-browser {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: white;
}

.file-item, .folder-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.file-item:last-child, .folder-item:last-child {
    border-bottom: none;
}

.file-item:hover, .folder-item:hover {
    background-color: rgba(27, 150, 67, 0.05);
}

.file-item-icon, .folder-item-icon {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
}

.file-item-name, .folder-item-name {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Permette il troncamento */
}

.file-item-name a,
.file-item-name strong,
.file-item-name h6 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Permette il troncamento */
}

.file-item-name .badge {
    flex-shrink: 0; /* Il badge non si riduce mai */
    white-space: nowrap; /* Il badge rimane su una riga */
}

.file-actions, .folder-actions {
    display: flex;
    gap: 0.5rem;
}

/* User Management */
.user-item {
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: white;
}

.user-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-item-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-item-email {
    color: var(--gray);
}

.user-item-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-item-status.active {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.user-item-status.inactive {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    padding-right: 3rem;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.search-result {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background-color: white;
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.search-result-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.search-result-score {
    background-color: rgba(27, 150, 67, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.search-result-excerpt {
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .content {
        padding: 1rem;
    }
    
    .hidden-sm {
        display: none;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .file-item-name, .folder-item-name {
        max-width: 200px;
    }
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--gray);
}

.breadcrumb-item.active {
    color: var(--primary);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

/* Modal */
.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(27, 150, 67, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--gray);
}

/* Custom checkbox */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary);
    border-color: var(--primary);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(27, 150, 67, 0.25);
}

/* Loading indicator */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.spinner-primary {
    color: var(--primary);
}
