
/* Rubrica Global Popup Styles */
.rubrica-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.rubrica-modal-container {
    width: 90%;
    max-width: 800px;
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.rubrica-header {
    padding: 20px 25px;
    background: linear-gradient(90deg, #313244, #1e1e2e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rubrica-header h2 {
    margin: 0;
    color: #f5e0dc;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rubrica-search-container {
    padding: 20px 25px;
    background: #181825;
}

.rubrica-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#rubrica-search-input {
    width: 100%;
    padding: 15px 20px;
    background: #1e1e2e;
    border: 2px solid #313244;
    border-radius: 12px;
    color: #cdd6f4;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

#rubrica-search-input:focus {
    border-color: #f9e2af;
    box-shadow: 0 0 15px rgba(249, 226, 175, 0.2);
}

.rubrica-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px 25px;
    max-height: 500px; /* Forza la scrollbar se ci sono molti risultati */
    min-height: 100px;
    scrollbar-width: thin;
    scrollbar-color: #f9e2af rgba(255,255,255,0.05);
}

.contact-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(249, 226, 175, 0.3);
    transform: translateX(5px);
}

.contact-info h3 {
    margin: 0 0 5px 0;
    color: #f9e2af;
    font-size: 1.1rem;
}

.contact-info p {
    margin: 2px 0;
    color: #a6adc8;
    font-size: 0.9rem;
}

.contact-actions {
    display: flex;
    gap: 10px;
}

.btn-call {
    background: #a6e3a1;
    color: #11111b;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-call:hover {
    background: #94e2d5;
}

.badge-oracle {
    background: #fab387;
    color: #11111b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar Style */
.rubrica-results::-webkit-scrollbar {
    width: 8px;
}

.rubrica-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.rubrica-results::-webkit-scrollbar-thumb {
    background: #f9e2af;
    border-radius: 10px;
}

.rubrica-results::-webkit-scrollbar-thumb:hover {
    background: #fab387;
}
/* Form Styles */
.rubrica-form {
    padding: 20px;
    background: #181825;
    border-radius: 12px;
    margin-top: 10px;
    display: none; /* Nascosto di default */
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    color: #f9e2af;
    font-size: 0.85rem;
}

.form-group input, .form-group textarea {
    padding: 10px;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 8px;
    color: #cdd6f4;
    outline: none;
}

.form-group input:focus {
    border-color: #fab387;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-save {
    background: #a6e3a1;
    color: #11111b;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cancel {
    background: #f38ba8;
    color: #11111b;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-edit-contact {
    background: #89b4fa;
    color: #11111b;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rubrica-header-actions {
    display: flex;
    gap: 10px;
}

.btn-new-contact {
    background: #a6e3a1;
    color: #11111b;
    border: none;
    padding: 5px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Toast Notifications */
.rubrica-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #313244;
    color: #cdd6f4;
    padding: 12px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 20000;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

.rubrica-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.rubrica-toast-success { border-left: 5px solid #a6e3a1; }
.rubrica-toast-error { border-left: 5px solid #f38ba8; }

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-content i { font-size: 1.2rem; }
.rubrica-toast-success i { color: #a6e3a1; }
.rubrica-toast-error i { color: #f38ba8; }

/* Email Styles */
.contact-email-link {
    color: #89dceb;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-email-link:hover {
    color: #94e2d5;
    text-decoration: underline;
}

.btn-email {
    background: #cba6f7;
    color: #11111b;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-email:hover {
    background: #b4befe;
}
