/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* Header */
header {
    background-color: #0064a0;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 85vw;
    margin: 0 auto;
    padding: 0 20px;
}

.rofim-logo {
    display: inline;
    max-height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-left: 2rem;
    margin-top: auto;
    margin-bottom: auto;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Layout principal */
.main-container {
    position: relative;
    /*max-width: 1200px;*/
    max-width: 85vw;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
}

/* Volet latéral */
.side-panel {
    position: fixed;
    top: 10vh;
    height: 90vh;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 90;
    padding: 20px;
    overflow-y: auto;
    min-width: 200px;
    max-width: 50vw;
}

.side-panel.active {
    left: 0;
}

.hide {
    display: none;
}

/* Poignée de redimensionnement */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: ew-resize;
    background-color: rgba(0, 100, 160, 0.1);
    z-index: 91;
}

.resize-handle:hover,
.resize-handle.resizing {
    background-color: rgba(0, 100, 160, 0.3);
}

/* Bouton toggle pour le volet */
.side-panel-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transition: left 0.3s ease;
    background-color: #0064a0;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 89;
}

.side-panel-toggle:hover {
    background-color: #004d80;
}

/* Contenu du volet */
.panel-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.panel-content {
    margin-bottom: 20px;
}

.panel-content h3 {
    margin-bottom: 10px;
    color: #0064a0;
}

pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

/* Contenu principal */
.content {
    transition: margin-left 0.3s ease;
}

.content.shifted {
    margin-left: 320px;
}

.content.overlay-active {
    pointer-events: none;
    opacity: 0.7;
    filter: blur(1px);
}

.content-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.section-title {
    color: #0064a0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Page messagerie */
.messaging-component {
    border: 1px solid #eee;
    border-radius: 4px;
    height: 600px;
    background-color: #f9f9f9;
    width: 100%;
    margin-top: 20px;
}

.messaging-component.hidden {
    display: none;
}

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

.title-sample-code {
    margin-top: 10px;
}

/* Boutons dans le volet latéral */
.control-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
}

.control-button {
    background-color: #0064a0;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    border: 1px solid #aaaaaa;
}

.control-button:disabled:hover {
    background-color: #cccccc;
    cursor: default;
}

.control-button:hover {
    background-color: #004d80;
}

/* Toast Container */
.p-toast-container {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 300px;
    z-index: 1000;
}

/* Toast Message */
:root {
    --success-color: #34A835;
    --info-color: #2196F3;
    --warn-color: #FF9800;
    --error-color: #F44336;
    --toast-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}
.p-toast-message {
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: var(--toast-shadow);
    display: flex;
    opacity: 0;
    transform: translateY(-40px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.p-toast-message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toast types */
.p-toast-message-success {
    background-color: white;
    border-left: 6px solid var(--success-color);
}

.p-toast-message-info {
    background-color: white;
    border-left: 6px solid var(--info-color);
}

.p-toast-message-warn {
    background-color: white;
    border-left: 6px solid var(--warn-color);
}

.p-toast-message-error {
    background-color: white;
    border-left: 6px solid var(--error-color);
}

/* Toast content */
.p-toast-message-content {
    padding: 12px;
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.p-toast-message-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 24px;
}

.p-toast-message-success .p-toast-message-icon {
    color: var(--success-color);
}

.p-toast-message-info .p-toast-message-icon {
    color: var(--info-color);
}

.p-toast-message-warn .p-toast-message-icon {
    color: var(--warn-color);
}

.p-toast-message-error .p-toast-message-icon {
    color: var(--error-color);
}

.p-toast-message-text {
    flex: 1;
}

.p-toast-summary {
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.p-toast-detail {
    margin: 0;
    color: #666;
}

.p-toast-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    padding: 0;
    margin-left: 8px;
    transition: color 0.2s;
}

.p-toast-icon-close:hover {
    color: #333;
}


/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Dialog Container */
.dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    /*max-height: 80vh;*/
    overflow: hidden;
    animation: dialogAppear 0.3s ease-out;
}

@keyframes dialogAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dialog Header */
.dialog-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Dialog Content */
.dialog-content {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Accordion Styles */
.accordion {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.accordion-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header.active {
    background: #007bff;
    color: white;
}

.accordion-icon {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 800px;
}

.accordion-body {
    padding: 1rem 1.5rem;
    line-height: 1.6;
    color: #495057;
}

/* Form Styles */
.form-group {
    margin: 1.5rem 0;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Dialog Footer */
.dialog-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: #007bff;
    color: white;
}
.btn-primary:hover {
    background: #0056b3;
}
.btn-primary[disabled],
.btn-primary:disabled {
    background: #0056b3;
    cursor: default;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Hide dialog by default */
.dialog-overlay.hidden {
    display: none;
}

.svg-icon { width: 1.5rem; height: 1.5rem; }
.icon-text-success { color: #28a745; }
.icon-text-danger { color: #dc3545; }

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 5px 10px 5px 0;
    }

    .content.shifted {
        margin-left: 0;
        transform: translateX(280px);
    }

    .doctors-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}