/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border-radius: 12px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Boutons */
.btn-primary, .btn-secondary, .btn-danger, .btn-link, .btn-download, .btn-remove {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-link {
    background: transparent;
    color: #3498db;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-link:hover {
    background: rgba(52, 152, 219, 0.1);
}

.btn-download {
    background: #27ae60;
    color: white;
    padding: 0.5rem 1rem;
}

.btn-download:hover {
    background: #219a52;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteneurs principaux */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card, .upload-container, .dashboard-container, .download-container, .error-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #7f8c8d;
    font-size: 0.875rem;
}

/* Demo codes */
.demo-codes {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.demo-codes p {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.demo-codes ul {
    list-style: none;
    padding: 0;
}

.demo-codes li {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Barre de progression */
.progress-container {
    margin: 1rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid #e1e8ed;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #7f8c8d;
}

/* Upload */
.file-drop-zone {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(248, 249, 250, 0.8);
    cursor: pointer;
}

.file-drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.drop-zone-content p {
    margin: 0.5rem 0;
    color: #7f8c8d;
}

.file-info {
    font-size: 0.875rem;
    color: #95a5a6;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

.file-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.file-size, .download-count {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-left: 1rem;
}

/* Messages */
.error-message {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.success-message {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
}

.success-message h3 {
    margin-bottom: 1rem;
}

.share-url {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
}

.share-url a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* Dashboard */
.shares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.share-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.share-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.share-code {
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
}

.share-actions {
    display: flex;
    gap: 0.5rem;
}

.share-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label {
    font-weight: 500;
    color: #7f8c8d;
}

.value {
    color: #2c3e50;
    font-weight: 500;
}

.share-link {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

.download-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.download-link:hover {
    text-decoration: underline;
}

.no-shares {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

/* Download page */
.download-container {
    max-width: 800px;
    margin: 0 auto;
}

.share-info {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.files-section h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.download-item {
    border: 2px solid #e1e8ed;
    transition: all 0.3s;
}

.download-item:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.download-all-section {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
}

.download-note {
    margin-top: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.footer-info {
    text-align: center;
    margin-top: 2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.no-files {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.files-details {
    margin-top: 1rem;
}

.file-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.3s;
}

.file-detail:hover {
    background: #f8f9fa;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1100;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #51cf66, #40c057);
}

.notification.error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.notification.info {
    background: linear-gradient(135deg, #339af0, #228be6);
}

/* Error page */
.error-container {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
    margin: 2rem auto;
}

.error-container h1 {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.error-container .error-message {
    margin: 2rem 0;
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .shares-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .share-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .share-actions {
        width: 100%;
        justify-content: center;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .upload-container, .dashboard-container, .download-container {
        padding: 1rem;
    }
    
    .file-drop-zone {
        padding: 2rem 1rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}