* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start; /* alinha no topo */
    padding: 0 20px;
}

.upload-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px); /* limita pela altura da viewport */
    overflow-y: auto; /* scroll quando necessário */
    scrollbar-gutter: stable; /* reserva espaço para scrollbar */
}

/* Estilização da scrollbar para upload-section */
.upload-section::-webkit-scrollbar {
    width: 6px;
}

.upload-section::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.upload-section::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.upload-section::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.result-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    box-sizing: border-box;
}

.recent-files-section {
    background: white;
    border-radius: 20px;
    padding: 40px; /* mesmo padding da coluna esquerda */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    box-sizing: border-box;
    max-height: calc(100vh - 220px); /* limita pela altura da viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* evita que a barra interna altere a altura visual */
}

.recent-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.recent-files-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
    margin: 0;
}

.btn-view-all {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.recent-files-list {
    flex: 1;               /* ocupa o restante e iguala alturas */
    overflow-y: auto;      /* scroll vertical quando necessário */
    min-height: 0;         /* permite flex encolher para scroll */
    scrollbar-gutter: stable both-edges; /* reserva espaço fixo p/ scrollbar */
    padding-right: 5px;    /* espaço para a scrollbar */
}

/* Estilização da scrollbar */
.recent-files-list::-webkit-scrollbar {
    width: 6px;
}

.recent-files-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.recent-files-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.recent-files-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Indicador de scroll quando há mais itens */
.recent-files-list::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recent-files-list.has-scroll::after {
    opacity: 1;
}

.loading-files {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #718096;
}

.loading-files .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.recent-file-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.recent-file-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.recent-file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.recent-file-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    word-break: break-word;
    flex: 1;
    margin-right: 10px;
    line-height: 1.4;
}

.recent-file-size {
    color: #718096;
    font-size: 0.8rem;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.recent-file-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.recent-file-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.recent-file-status.expired {
    background: #fed7d7;
    color: #742a2a;
}

.recent-file-status.limit {
    background: #fef5e7;
    color: #744210;
}

.recent-file-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    padding: 12px;
    background: #f7fafc;
    border-radius: 10px;
}

.recent-file-info-item {
    display: flex;
    flex-direction: column;
}

.recent-file-info-label {
    color: #718096;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.recent-file-info-value {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.recent-file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recent-file-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.recent-file-btn.copy {
    background: #667eea;
    color: white;
}

.recent-file-btn.copy:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.recent-file-btn.download {
    background: #48bb78;
    color: white;
}

.recent-file-btn.download:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.recent-file-btn.delete {
    background: #e53e3e;
    color: white;
}

.recent-file-btn.delete:hover {
    background: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.empty-recent-files {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.empty-recent-files h4 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.empty-recent-files p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.empty-recent-files .btn-upload-first {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.empty-recent-files .btn-upload-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #f7fafc;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #e6f2ff;
    transform: scale(1.02);
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.drop-zone h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2d3748;
}

.drop-zone p {
    color: #718096;
    font-size: 16px;
    margin-bottom: 5px;
}

.file-limit {
    font-size: 14px !important;
    color: #a0aec0 !important;
    margin-top: 10px !important;
}

#fileInput {
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.file-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.file-name {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 5px;
}

.file-size {
    color: #718096;
    font-size: 14px;
}

.btn-remove {
    background: #fc8181;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #f56565;
    transform: scale(1.1);
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 15px;
}

.select-input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-upload {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-upload:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.progress-container {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

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

.progress-text {
    text-align: center;
    color: #718096;
    font-weight: 600;
}

.result-section {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.result-section h2 {
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 28px;
}

.link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.share-link {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #2d3748;
    background: #f7fafc;
}

.btn-copy {
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-copy svg {
    width: 20px;
    height: 20px;
}

.file-details-result {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.file-details-result p {
    margin: 10px 0;
    color: #4a5568;
    font-size: 14px;
}

.file-details-result strong {
    color: #2d3748;
}

.btn-new-upload {
    padding: 14px 30px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-new-upload:hover {
    background: #667eea;
    color: white;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.9;
    font-size: 14px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .upload-section {
        padding: 30px 20px;
    }
    
    .recent-files-section {
        padding: 20px;
        min-height: 300px;
    }
    
    .result-section {
        padding: 30px 20px;
        margin: 20px 10px;
    }
    
    .options {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 36px;
    }
    
    .upload-section, .result-section {
        padding: 25px;
    }
    
    .recent-files-section {
        padding: 20px;
    }
    
    .recent-files-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .recent-file-info {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .recent-file-actions {
        justify-content: center;
    }
    
    .recent-file-btn {
        flex: 1;
        text-align: center;
    }
    
    .drop-zone {
        padding: 40px 15px;
    }
    
    .link-container {
        flex-direction: column;
    }
}