/* =====================
   Reset & Base Mobile-First
===================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.dropit {
    min-height: 100vh;
    background: var(--dark-bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0.75rem;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =====================
   Intro Mobile-First
===================== */
.dropit-intro {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.dropit-intro h3 {
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropit-intro ol {
    margin: 0;
    padding-left: 1.2rem;
}

.dropit-intro li {
    margin-bottom: 0.3rem;
}

/* =====================
   Upload Box Mobile-First
===================== */
.upload-box {
    background: var(--dark-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.upload-box:hover {
    background: var(--dark-card-hover);
    border-color: var(--primary-gold);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.upload-box h2 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-gold), #f4e58c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-wrap: break-word;
}

/* =====================
   Formulaire Mobile-First
===================== */
#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* File Input Mobile */
#fileInput {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--text-muted);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
}

#fileInput:hover,
#fileInput:focus {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 15px var(--gold-glow);
}

#fileInput::file-selector-button {
    background: var(--primary-gold);
    color: var(--dark-bg);
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

#fileInput::file-selector-button:hover {
    background: #c19b2b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--gold-glow);
}

/* =====================
   Boutons Mobile-First
===================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-gold), #c19b2b);
    color: var(--dark-bg);
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--gold-glow);
    background: linear-gradient(135deg, #c19b2b, var(--primary-gold));
}

.btn--primary:active {
    transform: translateY(0);
}

/* =====================
   Progress Bar Mobile
===================== */
.progress {
    width: 100%;
    max-width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), #f4e58c);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* =====================
   Upload Result Mobile
===================== */
.upload-result {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

.upload-result a {
    color: #4f8cff;
    word-break: break-all;
    text-decoration: none;
    font-size: 0.8rem;
}

.upload-result a:hover {
    text-decoration: underline;
}

/* Bouton copier mobile */
.upload-result .btn-copy {
    background: #4f8cff;
    border: none;
    color: #fff;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    max-width: 120px;
}

.upload-result .btn-copy:hover {
    background: #3a6edc;
}

.upload-result .btn-copy:active {
    transform: scale(0.98);
}

/* =====================
   Files Box Mobile-First
===================== */
.files-box {
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.2s;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.files-box h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.files-list .empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 1.5rem 0.5rem;
    border-radius: var(--border-radius);
    border: 1px dashed var(--text-muted);
    font-size: 0.85rem;
}

/* ============================
   🧱 File Item — Responsive Grid
============================ */
.file-item {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 1fr 1fr;
    /* nom | taille | téléchargements | expiration | actions */
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.25s ease;
    animation: slideInFromRight 0.4s ease-out;
    width: 100%;
    overflow: hidden;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.file-size,
.file-expire {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.file-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* ===== Boutons ===== */
.file-actions button {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-copy {
    background: var(--primary-gold);
    color: var(--dark-bg);
}

.btn-copy:hover {
    background: #c19b2b;
}

.btn-delete {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* ====== Boutons ====== */
.file-actions button {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-copy {
    background: var(--primary-gold);
    color: var(--dark-bg);
}

.btn-copy:hover {
    background: #c19b2b;
}

.btn-delete {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* =====================
   Responsive Tablet (768px+)
===================== */
@media (min-width: 768px) {
    .dropit {
        padding: 1rem;
    }

    .container {
        max-width: 1200px;
        gap: 1.5rem;
    }

    #uploadForm {
        flex-direction: row;
        align-items: flex-end;
        gap: 1rem;
    }

    #fileInput {
        flex: 1;
        min-height: auto;
        font-size: 1rem;
    }

    .btn {
        white-space: nowrap;
        width: auto;
        font-size: 1rem;
        padding: 14px 32px;
    }

    .upload-box,
    .files-box {
        padding: 1.5rem;
    }

    .file-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .file-name {
        max-width: 250px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1rem;
    }

    .file-actions {
        flex-direction: row;
        width: auto;
        gap: 0.5rem;
    }

    .file-actions button {
        width: auto;
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .upload-result {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .upload-result .btn-copy {
        width: auto;
        max-width: none;
    }
}

@media (max-width: 750px) {
    .file-item {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .file-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* =====================
   Responsive Desktop (1024px+)
===================== */
@media (min-width: 1024px) {
    .dropit {
        padding: 1.5rem;
    }

    .upload-box,
    .files-box {
        padding: 2rem;
    }

    .file-name {
        max-width: 400px;
    }

    .dropit-intro {
        font-size: 0.95rem;
    }

    .upload-box h2,
    .files-box h2 {
        font-size: 1.5rem;
    }
}

/* =====================
   Responsive Large Desktop (1200px+)
===================== */
@media (min-width: 1200px) {
    .file-name {
        max-width: 500px;
    }
}

/* =====================
   Animations & Accessibilité
===================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn:focus,
#fileInput:focus,
.btn-copy:focus,
.btn-delete:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* =====================
   Gestion des très petits écrans
===================== */
@media (max-width: 320px) {
    .dropit {
        padding: 0.5rem;
    }

    .upload-box,
    .files-box {
        padding: 0.75rem;
    }

    .upload-box h2,
    .files-box h2 {
        font-size: 1.1rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .file-name {
        font-size: 0.8rem;
    }

    .file-actions button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* ============================
   📱 Responsive (mobile)
============================ */
@media (max-width: 650px) {
    .file-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .file-actions {
        justify-content: flex-start;
    }
}