/* ===================================
   Trajecto Platform - Styles communs
   =================================== */

/* === ANIMATIONS COMMUNES === */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* === RESET ET BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === CLASSE COMMUNE CARTE BLANCHE === */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

body {
    background: linear-gradient(-45deg, #2ecc71, #27ae60, #16a085, #3498db);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* === CONTENEUR PRINCIPAL === */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* === HEADER === */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.header h1 i {
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* === LIEN RETOUR === */
.back-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffd700;
    transform: translateX(-5px);
    text-decoration: none;
}

/* === SECTION INFO === */
.info-section {
    margin-bottom: 30px;
}

.info-section h4 {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 15px;
}

.info-section h4 i {
    color: #2ecc71;
    margin-right: 10px;
}

.info-section p {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.info-section ul {
    padding-left: 20px;
    margin-top: 10px;
}

.info-section ul li {
    margin-bottom: 8px;
    color: #555;
}

.info-section code {
    background: rgba(46, 204, 113, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #27ae60;
}

/* Section info repliable */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
    transition: color 0.3s;
    margin-bottom: 0 !important;
}

.collapsible-header:hover {
    color: #2ecc71;
}

.collapse-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.collapsible-header[aria-expanded="true"] .collapse-icon {
    transform: translateY(-50%) rotate(180deg);
}

.collapsible-content {
    padding-top: 15px;
}

/* === SECTION UPLOAD === */
.upload-section {
    margin-bottom: 30px;
}

.drop-container {
    cursor: pointer;
    width: 100%;
    text-align: center;
    border: 3px solid rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
    padding: 40px;
}

.drop-container > i {
    font-size: 4.5rem;
    color: #2ecc71;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(46, 204, 113, 0.3));
}

#fileList {
    margin-top: 15px;
    text-align: left;
    background: rgba(46, 204, 113, 0.1);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2ecc71;
}

#fileList i {
    font-size: 1rem;
    margin-right: 8px;
}

#fileList .file-item {
    padding: 5px 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.drop-title {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.drop-container p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

input[type=file] {
    display: none;
}

.form-control {
    margin-top: 15px;
    border: 2px solid #2ecc71;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus {
    border-color: #27ae60;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
    outline: none;
}

.form-label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* === CONSOLE === */
.console-container {
    margin-top: 30px;
}

.console-container h5 {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.console-container h5 i {
    color: #2ecc71;
    margin-right: 10px;
}

#textContainer {
    width: 100%;
    height: 350px;
    border: 2px solid #34495e;
    overflow-y: auto;
    padding: 15px;
    background: linear-gradient(135deg, #1e272e 0%, #34495e 100%);
    color: #2ecc71;
    font-family: 'Courier New', monospace;
    border-radius: 12px;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.3);
    font-size: 0.95rem;
    line-height: 1.6;
}

#textContainer div {
    margin: 3px 0;
}

/* Scrollbar personnalisé */
#textContainer::-webkit-scrollbar {
    width: 10px;
}

#textContainer::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 10px;
}

#textContainer::-webkit-scrollbar-thumb {
    background: #2ecc71;
    border-radius: 10px;
}

#textContainer::-webkit-scrollbar-thumb:hover {
    background: #27ae60;
}

/* === BOUTONS === */
.btn-clear,
.btn-primary {
    margin-top: 15px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    cursor: pointer;
    font-size: 1rem;
}

.btn-clear:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.btn-clear i,
.btn-primary i {
    margin-right: 8px;
}

/* === FORMULAIRES SELECT === */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232ecc71' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
    appearance: none;
}

.form-group {
    margin-top: 15px;
    text-align: left;
}

/* === PARAMETRES DU FORMULAIRE === */
.form-parameters {
    margin-top: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 2px solid rgba(46, 204, 113, 0.2);
}


/* === PREVIEW SECTION === */
.preview-section {
    margin-top: 30px;
}

.preview-section h5 {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.preview-section h5 i {
    color: #2ecc71;
    margin-right: 10px;
}

#previewContainer {
    text-align: center;
    padding: 20px 0;
}

#previewContainer img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    cursor: pointer;
}

#previewContainer img:hover {
    transform: scale(1.02);
}

#previewContainer a {
    display: inline-block;
    margin-top: 15px;
    color: #2ecc71;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

#previewContainer a:hover {
    color: #27ae60;
    transform: translateY(-2px);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .drop-container {
        width: 100%;
        max-width: 400px;
    }

    #textContainer {
        height: 250px;
    }

    .side-by-side-container {
        flex-direction: column;
    }
}

/* === BARRE DE PROGRESSION === */
.progress-section {
    margin-bottom: 30px;
    display: none; /* Caché par défaut, affiché via JavaScript */
}

.progress-section.show {
    display: block;
}

.progress-section h5 {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.progress-section h5 i {
    color: #2ecc71;
    margin-right: 10px;
}

.progress-info {
    color: #34495e;
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-info .progress-status {
    font-weight: 600;
}

.progress-info .progress-percentage {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.1rem;
}

.progress-bar-container {
    background: #ecf0f1;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

.progress-bar-fill.completed {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.progress-bar-fill.error {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* Animation de progression */
@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.progress-bar-fill:not(.completed):not(.error) {
    animation: progressPulse 2s ease-in-out infinite;
}
