/* 
 * Plan de Maîtrise Sanitaire - Styles CSS Frontend
 * Fichier: assets/css/pms-style.css
 * Couleurs thème:
 * Vert: #8ec052
 * Bleu: #171940
 * Gris: #efefef
 */

:root {
    --pms-green: #8ec052;
    --pms-blue: #171940;
    --pms-grey: #efefef;
    --pms-orange: #ff9800;
    --pms-red: #f44336;
    --pms-white: #ffffff;
    --pms-shadow: rgba(0, 0, 0, 0.1);
}

/* === RESET ET BASE === */
.pms-login-container *,
.pms-dashboard *,
.pms-module * {
    box-sizing: border-box;
}

/* === PAGE DE CONNEXION === */
.pms-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--pms-blue) 0%, var(--pms-green) 100%);
}

.pms-login-form {
    background: var(--pms-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--pms-shadow);
    width: 100%;
    max-width: 400px;
}

.pms-login-form h2 {
    color: var(--pms-blue);
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.pms-login-form .form-group {
    margin-bottom: 20px;
}

.pms-login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--pms-blue);
    font-weight: 500;
}

.pms-login-form input[type="text"],
.pms-login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--pms-grey);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.pms-login-form input[type="text"]:focus,
.pms-login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--pms-green);
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
}

/* === BOUTONS === */
.pms-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.pms-btn-primary {
    background: var(--pms-green);
    color: var(--pms-white);
}

.pms-btn-primary:hover {
    background: #7ab841;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 192, 82, 0.3);
}

.pms-btn-secondary {
    background: var(--pms-grey);
    color: var(--pms-blue);
}

.pms-btn-secondary:hover {
    background: #ddd;
}

.pms-btn-danger {
    background: var(--pms-red);
    color: var(--pms-white);
}

.pms-btn-danger:hover {
    background: #d32f2f;
}

/* === TABLEAU DE BORD === */
.pms-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 3px solid var(--pms-green);
}

.pms-header h1 {
    color: var(--pms-blue);
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.pms-logout {
    color: var(--pms-red);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid var(--pms-red);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pms-logout:hover {
    background: var(--pms-red);
    color: var(--pms-white);
}

/* === GRILLE BENTO === */
.pms-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pms-tile {
    background: var(--pms-white);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--pms-grey);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 10px var(--pms-shadow);
}

.pms-tile:hover {
    border-color: var(--pms-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(142, 192, 82, 0.2);
}

.pms-tile .tile-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.pms-tile h3 {
    color: var(--pms-blue);
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.pms-tile p {
    color: #666;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* === MODULES === */
.pms-module-content {
    background: var(--pms-white);
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--pms-shadow);
    overflow: hidden;
}

.pms-module {
    padding: 30px;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--pms-grey);
}

.module-header h2 {
    color: var(--pms-blue);
    margin: 0;
    font-size: 26px;
    font-weight: 600;
}

/* === FORMULAIRES === */
.pms-form {
    background: var(--pms-grey);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--pms-blue);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: var(--pms-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--pms-green);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* === INDICATEURS DE CONFORMITÉ === */
.compliance-indicator {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.compliance-result {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* === SECTIONS SPÉCIALISÉES === */
.cooling-section {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--pms-green);
}

.cooling-section h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 18px;
}

.reception-section {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--pms-green);
}

.reception-section h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 18px;
}

/* === ENTRÉES RÉCENTES === */
.recent-entries {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--pms-grey);
}

.recent-entries h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 20px;
}

.entries-list {
    max-height: 300px;
    overflow-y: auto;
}

.entry-item {
    padding: 15px;
    border-bottom: 1px solid var(--pms-grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-item:last-child {
    border-bottom: none;
}

.entry-info {
    flex: 1;
}

.entry-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: var(--pms-white);
}

.status-conforme {
    background: var(--pms-green);
}

.status-attention {
    background: var(--pms-orange);
}

.status-non-conforme {
    background: var(--pms-red);
}

/* === UPLOAD DE FICHIERS === */
.file-upload-area {
    border: 2px dashed var(--pms-grey);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: var(--pms-white);
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--pms-green);
}

.file-upload-area.dragover {
    border-color: var(--pms-green);
    background: rgba(142, 192, 82, 0.1);
}

.file-upload-area input[type="file"] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.file-upload-area p {
    margin: 10px 0;
    color: var(--pms-blue);
    font-weight: 500;
}

.file-upload-area small {
    color: #666;
    font-size: 12px;
}

/* === RAPPORTS === */
.reports-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 30px;
}

.report-section {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--pms-grey);
}

.quick-reports {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--pms-grey);
}

.quick-reports h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 18px;
}

.quick-report-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-history {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--pms-grey);
    grid-column: 1 / -1;
}

.report-history h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 18px;
}

/* === DOCUMENTS === */
.documents-list {
    background: var(--pms-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--pms-grey);
}

.documents-list h3 {
    color: var(--pms-blue);
    margin: 0 0 15px 0;
    font-size: 20px;
}

.document-category {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pms-grey);
}

.document-category:last-child {
    border-bottom: none;
}

.document-category h4 {
    color: var(--pms-blue);
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.category-documents {
    min-height: 50px;
    padding: 10px;
    background: var(--pms-grey);
    border-radius: 4px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .pms-dashboard {
        padding: 10px;
    }
    
    .pms-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pms-header h1 {
        font-size: 22px;
    }
    
    .pms-bento-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pms-tile {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .reports-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quick-report-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .pms-login-form {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .pms-module {
        padding: 20px 15px;
    }
    
    .pms-form {
        padding: 20px 15px;
    }
    
    .pms-tile .tile-icon {
        font-size: 36px;
    }
    
    .pms-tile h3 {
        font-size: 18px;
    }
}

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

.pms-module-content {
    animation: fadeIn 0.3s ease-out;
}

.pms-tile {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === UTILITAIRES === */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* === SCROLLBAR PERSONNALISÉE === */
.entries-list::-webkit-scrollbar {
    width: 8px;
}

.entries-list::-webkit-scrollbar-track {
    background: var(--pms-grey);
    border-radius: 4px;
}

.entries-list::-webkit-scrollbar-thumb {
    background: var(--pms-green);
    border-radius: 4px;
}

.entries-list::-webkit-scrollbar-thumb:hover {
    background: #7ab841;
}

/* === ÉTATS DE CHARGEMENT === */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--pms-grey);
    border-top: 2px solid var(--pms-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === MESSAGES ET NOTIFICATIONS === */
.pms-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.pms-message-success {
    background: var(--pms-green);
    color: var(--pms-white);
}

.pms-message-error {
    background: var(--pms-red);
    color: var(--pms-white);
}

.pms-message button {
    background: none;
    border: none;
    color: var(--pms-white);
    float: right;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
}