/* CSS pour les pages publiques RAMA */

/* Header RAMA */
.rama-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.rama-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.rama-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Footer RAMA */
.rama-footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.rama-footer a {
    color: #3498db;
    text-decoration: none;
}

.rama-footer a:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Page médicament */
.medicament-detail {
    margin-top: 2rem;
}

.medicament-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #3498db;
}

.medicament-name {
    color: #2c3e50;
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.medicament-dci {
    color: #7f8c8d;
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.medicament-basic-info .badge {
    font-size: 0.9rem;
    margin-right: 0.5rem;
    padding: 0.5rem 1rem;
}

/* Prix */
.medicament-pricing {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.price-box {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.price-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #27ae60;
}

/* Sections d'information */
.medicament-regulatory,
.medicament-indication,
.medicament-conservation,
.medicament-contraindications,
.medicament-side-effects,
.medicament-documents,
.medicament-videos {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.medicament-regulatory h4,
.medicament-indication h4,
.medicament-conservation h4,
.medicament-contraindications h4,
.medicament-side-effects h4,
.medicament-documents h4,
.medicament-videos h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.medicament-regulatory table {
    margin-bottom: 0;
}

.medicament-regulatory td {
    padding: 0.5rem 0;
    border: none;
}

/* Documents */
.documents-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.document-item {
    margin-bottom: 0.5rem;
}

/* Vidéos YouTube */
.video-container {
    margin-bottom: 1rem;
}

.youtube-video {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

/* Sidebar */
.medicament-photo,
.medicament-qr,
.medicament-stats,
.medicament-actions {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.medicament-photo h5,
.medicament-qr h5,
.medicament-stats h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.medicament-image,
.qr-code-image {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.qr-help {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Registre public */
.registre-public {
    margin-top: 2rem;
}

.registre-header {
    text-align: center;
    margin-bottom: 3rem;
}

.registre-header h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.registre-search {
    margin-bottom: 2rem;
}

.registre-results {
    margin-bottom: 2rem;
}

.results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.medicaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.medicament-card .card {
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.medicament-card .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.medicament-card .card-title a {
    color: #2c3e50;
    text-decoration: none;
}

.medicament-card .card-title a:hover {
    color: #3498db;
}

.price-highlight {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1rem;
}

/* Pagination */
.registre-pagination {
    margin-top: 2rem;
}

/* Pages d'erreur */
.error-page {
    padding: 3rem 0;
}

.error-page h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .rama-title {
        font-size: 2rem;
    }
    
    .rama-subtitle {
        font-size: 1rem;
    }
    
    .medicament-name {
        font-size: 1.8rem;
    }
    
    .medicament-dci {
        font-size: 1.2rem;
    }
    
    .medicaments-grid {
        grid-template-columns: 1fr;
    }
    
    .price-value {
        font-size: 1.5rem;
    }
    
    .youtube-video {
        height: 150px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.medicament-detail > div {
    animation: fadeIn 0.6s ease-out;
}

/* Navigation et Breadcrumb */
.rama-breadcrumb {
    margin-bottom: 1rem;
}

.rama-breadcrumb .breadcrumb {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.rama-breadcrumb .breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
}

.rama-breadcrumb .breadcrumb-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

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

.rama-navigation-actions {
    margin-bottom: 2rem;
    text-align: left;
}

.rama-navigation-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Navigation rapide du registre */
.registre-quick-nav {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.registre-quick-nav .btn {
    margin-bottom: 0.5rem;
}

/* Recherche avancée */
.registre-advanced-search {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.registre-advanced-search .form-group {
    margin-bottom: 1rem;
}

.registre-advanced-search label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Pages laboratoires */
.laboratoires-list,
.laboratoire-medicaments,
.classe-medicaments {
    margin-top: 2rem;
}

.laboratoires-header,
.laboratoire-header,
.classe-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #3498db;
}

.laboratoires-header h2,
.laboratoire-header h2,
.classe-header h2 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.laboratoires-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.laboratoire-card .card {
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.laboratoire-card .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.laboratoire-card .card-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.laboratoire-card .card-text {
    margin-bottom: 0.5rem;
}

.laboratoire-card .card-text i {
    color: #3498db;
    margin-right: 0.5rem;
    width: 15px;
}

/* Dropdown pour classes thérapeutiques */
.dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

/* Améliorations des cartes médicaments */
.medicament-card .card-body {
    padding: 1.25rem;
}

.medicament-card .card-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.medicament-card .card-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.medicament-card .badge {
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.medicament-card .card-text {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.medicament-card .btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .rama-navigation-actions {
        text-align: center;
    }
    
    .registre-quick-nav .col-md-4 {
        margin-bottom: 0.5rem;
    }
    
    .laboratoires-grid {
        grid-template-columns: 1fr;
    }
    
    .registre-advanced-search .row {
        margin-bottom: 1rem;
    }
    
    .dropdown-toggle {
        white-space: normal;
    }
}

@media (max-width: 576px) {
    .rama-breadcrumb .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .rama-navigation-actions .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .laboratoires-header h2,
    .laboratoire-header h2,
    .classe-header h2 {
        font-size: 1.8rem;
    }
}

/* Animations pour les nouvelles pages */
.laboratoire-card,
.medicament-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Délai d'animation pour effet en cascade */
.laboratoire-card:nth-child(1) { animation-delay: 0.1s; }
.laboratoire-card:nth-child(2) { animation-delay: 0.2s; }
.laboratoire-card:nth-child(3) { animation-delay: 0.3s; }
.laboratoire-card:nth-child(4) { animation-delay: 0.4s; }
.laboratoire-card:nth-child(5) { animation-delay: 0.5s; }
.laboratoire-card:nth-child(6) { animation-delay: 0.6s; }

.medicament-card:nth-child(1) { animation-delay: 0.1s; }
.medicament-card:nth-child(2) { animation-delay: 0.2s; }
.medicament-card:nth-child(3) { animation-delay: 0.3s; }
.medicament-card:nth-child(4) { animation-delay: 0.4s; }
.medicament-card:nth-child(5) { animation-delay: 0.5s; }
.medicament-card:nth-child(6) { animation-delay: 0.6s; }

/* Liens de navigation contextuels */
.laboratoire-link,
.classe-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.laboratoire-link:hover,
.classe-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.laboratoire-link:focus,
.classe-link:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Amélioration des liens dans les tableaux */
.medicament-regulatory .laboratoire-link,
.medicament-regulatory .classe-link {
    font-weight: 600;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.medicament-regulatory .laboratoire-link:hover,
.medicament-regulatory .classe-link:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

/* Icônes pour les liens contextuels */
.laboratoire-link::before {
    content: "🏢 ";
    font-size: 0.8em;
    margin-right: 2px;
}

.classe-link::before {
    content: "🏷️ ";
    font-size: 0.8em;
    margin-right: 2px;
}

/* Amélioration des cartes avec liens */
.medicament-card .laboratoire-link {
    font-size: 0.9rem;
    font-weight: 500;
}

.medicament-card .laboratoire-link::before {
    content: "";
    margin-right: 0;
}

/* Tooltip pour les liens */
.laboratoire-link[title],
.classe-link[title] {
    position: relative;
}

/* Amélioration de l'accessibilité */
.laboratoire-link:focus-visible,
.classe-link:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 3px;
}

/* Animation au survol des liens */
@keyframes linkHover {
    0% { transform: translateX(0); }
    50% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

.laboratoire-link:hover,
.classe-link:hover {
    animation: linkHover 0.3s ease;
}

/* Print styles */
@media print {
    .rama-header,
    .rama-footer,
    .medicament-actions,
    .rama-navigation-actions,
    .rama-breadcrumb,
    .btn {
        display: none !important;
    }
    
    .medicament-detail {
        margin-top: 0;
    }
    
    .medicament-regulatory,
    .medicament-indication,
    .medicament-conservation,
    .medicament-contraindications,
    .medicament-side-effects {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}