/* Main Styles for Formation Portal */

:root {
    --primary-color: #71A7AE;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
}

main {
    flex: 1;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 150px;
}

/* Course Cards */
.course-card {
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.course-image {
    height:200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.course-image-placeholder {
    height: 200px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* Course Content */
.section-card {
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.content-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-text {
    line-height: 1.6;
}

/* Admin Forms */
.admin-form {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table-actions {
    white-space: nowrap;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .login-container {
        margin: 20px auto;
        max-width: 90%;
    }
    
    .course-card {
        margin-bottom: 20px;
    }
}

/* Custom Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

/* File Type Icons */
.file-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.file-pdf {
    color: #e74c3c;
}

.file-audio {
    color: #9b59b6;
}

.file-video {
    color: #3498db;
}

.file-image {
    color: #27ae60;
}

/* Password Strength Meter */
.password-strength-meter {
    height: 5px;
    margin-top: 5px;
    margin-bottom: 15px;
    background-color: #eee;
    border-radius: 3px;
}

.password-strength-meter div {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.strength-weak {
    width: 25%;
    background-color: var(--danger-color);
}

.strength-medium {
    width: 50%;
    background-color: var(--warning-color);
}

.strength-strong {
    width: 75%;
    background-color: var(--success-color);
}

.strength-very-strong {
    width: 100%;
    background-color: #219653;
}

/* Upload Loading Indicator */
.upload-loading {
    display: none;
    text-align: center;
    margin: 15px 0;
}

.upload-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* PDF Protection Styles */
.pdf-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.pdf-viewer {
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.pdf-overlay {
    background: transparent;
    pointer-events: none;
}

/* Disable print screen and other shortcuts for PDF containers */
.pdf-container * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.upload-message {
    color: var(--primary-color);
    font-weight: 500;
}

.upload-success {
    display: none;
    color: var(--success-color);
    font-weight: 500;
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
}

/* Réactiver la sélection de texte et le clic droit */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Réactiver la sélection pour les administrateurs */
body.is-admin *,
body.is-admin .pdf-container *,
body.is-admin .pdf-viewer,
body.is-admin [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}
input, textarea, select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Permettre la sélection pour les éléments éditables */
[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}