/* ========== BASE STYLES ========== */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.container {
    width: 100%;
    padding: 15px;
    margin-bottom: 50px;
}

/* ========== MODAL ========== */
#loadingModal .modal-dialog {
    width: 300px;
    max-width: 90%;
    margin: 10px auto;
}

#loadingModal .modal-content {
    text-align: center;
    padding: 20px;
}

#loadingModal .modal-body {
    font-size: 16px;
}

/* ========== FORM CONTROLS ========== */
.form-control,
#commentaires,
#otherReason {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    padding: 12px;
    -webkit-appearance: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ========== RADIO BUTTONS ========== */
input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

input[type="radio"] + label {
    display: inline-block;
    cursor: pointer;
    line-height: 24px;
    margin-bottom: 10px;
}

/* ========== DROP AREA ========== */
#dropArea {
    padding: 40px 20px;
    border: 2px dashed #007bff;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    margin: 15px 0;
    font-size: 16px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 120px;
    transition: all 0.3s ease;
}

#dropArea:hover,
#dropArea:focus {
    border-color: #0056b3;
    background-color: #e9ecef;
}

/* ========== FILE TABLE ========== */
#fileTable {
    width: 100%;
    margin-top: 15px;
    overflow-x: auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#fileTable th,
#fileTable td {
    text-align: center;
    vertical-align: middle;
    padding: 12px 8px;
}

.remove-file {
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
}

/* ========== ALERTS ========== */
#dynamicAlert {
    position: fixed;
    top: 20px;
    left: 10px;
    right: 10px;
    width: auto;
    z-index: 9999;
    display: none;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

.alert .close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
}

/* ========== BUTTONS ========== */
.btn-participant,
.btn-primary,
#selectFileBtn,
#clearFiles,
button[type="submit"] {
    background-color: #1224B8;
    border-color: #1224B8;
    color: #fff;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    min-height: 48px;
    font-weight: 600;
    touch-action: manipulation;
    margin-bottom: 10px;
}

.btn-participant:hover,
.btn-primary:hover {
    background-color: #0d1a8a;
    border-color: #0d1a8a;
}

.fixed-position {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ========== CHARACTER COUNT ========== */
#charCount {
    text-align: right;
    font-size: 13px;
    margin-top: 5px;
    color: #666;
}

/* ========== LABELS ========== */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
}

.form-label {
    font-size: 16px;
    margin-bottom: 15px;
}

/* ========== RESPONSIVE - TABLETTE ========== */
@media (min-width: 768px) {
    .container {
        padding: 30px;
        max-width: 750px;
    }

    #dynamicAlert {
        left: 5%;
        right: 5%;
        width: 90%;
        max-width: 800px;
        margin: 0 auto;
    }

    #dropArea {
        padding: 50px 30px;
        min-height: 150px;
        font-size: 18px;
    }

    .btn-participant,
    .btn-primary,
    #selectFileBtn,
    #clearFiles,
    button[type="submit"] {
        width: auto;
        min-width: 140px;
        margin-bottom: 0;
    }

    .fixed-position {
        flex-direction: row;
        justify-content: flex-end;
        gap: 10px;
    }

    .form-label {
        font-size: 18px;
    }

    textarea.form-control {
        min-height: 100px;
    }
}

/* ========== RESPONSIVE - DESKTOP ========== */
@media (min-width: 992px) {
    .container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    #dynamicAlert {
        left: 10%;
        right: 10%;
        width: 80%;
    }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 767px) {
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }

    input[type="radio"] + label {
        font-size: 15px;
        display: block;
        margin-left: 32px;
        margin-bottom: 15px;
    }

    #fileTable {
        font-size: 14px;
    }

    #fileTable th:first-child,
    #fileTable td:first-child {
        max-width: 180px;
        word-wrap: break-word;
        white-space: normal;
    }

    .text-center p {
        font-size: 14px;
    }
}

/* ========== RESPONSIVE - LANDSCAPE MOBILE ========== */
@media (max-width: 767px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }

    #dropArea {
        min-height: 80px;
        padding: 20px 10px;
    }
}

/* ========== iOS FIXES ========== */
@supports (-webkit-touch-callout: none) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ========== PREVENT ZOOM ON DOUBLE-TAP ========== */
button,
input,
select,
textarea {
    touch-action: manipulation;
}
