/* Generale */
body {
    font-family: "Segoe UI", sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    min-height: 100vh;
    color: #333;
}

/* Contenitore principale */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Header */
.header {
    background: #009688;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    margin: 0;
}

.menu-button {
    background: #00796b;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.menu-button:hover {
    background: #005f56;
}

/* Barra di ricerca e pulsanti */
.search-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input[type="text"] {
    width: 280px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-box button {
    background: #25d366;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
.search-box button:hover {
    background: #1aa34a;
}

/* Tabella Contatti */
table.contacts-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

table.contacts-table thead {
    background: #009688;
    color: white;
}

table.contacts-table th,
table.contacts-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

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

.actions a {
    margin-right: 8px;
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

.actions a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-box form {
        width: 100%;
    }

    .search-box input[type="text"] {
        width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Stili per home.php, login.php e header comune */
.site-header {
    background-color: #25D366;
    color: white;
    padding: 20px;
    text-align: center;
}

.site-header h1 {
    margin: 0;
    font-size: 2em;
}

.site-header p {
    margin: 5px 0 0;
}

.main-nav {
    background-color: #128C7E;
    display: flex;
    justify-content: center;
}

.main-nav a {
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    display: inline-block;
}

.main-nav a:hover {
    background-color: #075E54;
}

.site-footer {
    margin-top: 50px;
    padding: 20px;
    text-align: center;
    background-color: #eaeaea;
    color: #666;
}

/* Stili per login.php */
.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 40px auto;
}

.login-box h1 {
    color: #25D366;
    font-size: 2em;
    margin-bottom: 20px;
}

.login-box p {
    font-size: 1.1em;
    margin-bottom: 25px;
    color: #666;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-form button {
    width: 100%;
    background-color: #25D366;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: #128C7E;
}

.error-message {
    color: #e74c3c;
    background-color: #fdedeb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Stili per dashboard.php */
.top-bar {
    background-color: #128C7E;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
}

.top-bar .user-info .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #075E54;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
}

.top-bar .logout-link {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.1);
    transition: background-color 0.3s;
}

.top-bar .logout-link:hover {
    background-color: rgba(255,255,255,0.2);
}

.dashboard-box {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-box h1 {
    color: #128C7E;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.menu-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.menu-item i {
    font-size: 36px;
    margin-bottom: 15px;
    color: #25D366;
}

.menu-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: block;
}

/* Stili per company_settings.php */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-title {
    color: #128C7E;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #25D366;
    font-size: 1.3em;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group img {
    margin: 10px 0;
}

.form-divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 20px 0;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #25D366;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #1aa34a;
}

.btn-secondary {
    background: #128C7E;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #075E54;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Stili per la gestione contatti */
.contacts-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contacts-header h1 {
    color: #128C7E;
    font-size: 1.8em;
    margin: 0;
}

.contacts-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-contacts {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-contacts input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.contact-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.contact-form button {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: #1aa34a;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.contacts-table .action-buttons a {
    display: inline-block;
    margin-right: 5px;
    padding: 5px 10px;
    color: white;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
}

.contacts-table .action-buttons .chat-btn {
    background-color: #25D366;
}

.contacts-table .action-buttons .edit-btn {
    background-color: #3498db;
}

.contacts-table .action-buttons .delete-btn {
    background-color: #e74c3c;
}

.contacts-table .action-buttons a:hover {
    opacity: 0.9;
}