:root {
    --primary: #0052D4;
    --primary-hover: #0041a8;
    --accent: #1EAF5B;
    --accent-hover: #168a47;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --badge-bg: #F0F5FF;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-font-smoothing: antialiased; }
body {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    background-image: radial-gradient(at 100% 0%, rgba(0, 82, 212, 0.05) 0px, transparent 50%);
}

/* Header */
header {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.navbar { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo { text-decoration: none; display: flex; align-items: center; }
.main-logo { height: 40px; width: auto; display: block; }
.mobile-logo { display: none; }

@media (max-width: 600px) {
    .main-logo { display: none; }
    .mobile-logo { display: block; height: 32px; width: auto; }
}

/* Container */
.container { max-width: 1100px; margin: 3rem auto; padding: 0 1.5rem; text-align: center; }
.header-section { margin-bottom: 3rem; }
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; }

/* Drop Zone */
.drop-zone {
    background: var(--card-bg);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
}
.drop-zone:hover { border-color: var(--accent); background: #f0fdf4; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.drop-icon { font-size: 3rem; margin-bottom: 1rem; }
.drop-text { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.drop-info { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
#file-input { display: none; }

/* Extract Section */
.extract-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease-out;
    text-align: left;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.selection-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.file-info { display: flex; align-items: center; gap: 1rem; }
.zip-name { font-weight: 700; color: var(--text-main); }
.badge { background: var(--badge-bg); color: var(--primary); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; }

.btn-action {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-action:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 82, 212, 0.3); }
.btn-action:disabled { background: #cbd5e1; cursor: not-allowed; opacity: 0.7; }

.btn-text-action {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-text-action:hover { background: var(--badge-bg); }

.btn-clear-data {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-clear-data:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}


/* Grid de Arquivos */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.file-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex; flex-direction: column; gap: 10px; user-select: none;
}
.file-card:hover { border-color: #cbd5e1; transform: translateY(-3px); }
.file-card.selected { border-color: var(--primary); background-color: #f0f7ff; box-shadow: 0 4px 12px rgba(0, 82, 212, 0.1); }

.file-card::after {
    content: '✓';
    position: absolute; top: -10px; right: -10px;
    width: 28px; height: 28px;
    background: var(--primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 800;
    opacity: 0; transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10;
}
.file-card.selected::after { opacity: 1; transform: scale(1); }

footer {
    padding: 4rem 1.5rem;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.preview-box {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ext-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name-card {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size-card {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}
.loading-overlay.active { visibility: visible; opacity: 1; }

.spinner-box { width: 80px; height: 80px; position: relative; margin-bottom: 2rem; }
.spinner { width: 100%; height: 100%; border: 6px solid #f1f5f9; border-top: 6px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.spinner-inner { position: absolute; top: 15px; left: 15px; right: 15px; bottom: 15px; border: 4px solid #f1f5f9; border-top: 4px solid var(--accent); border-radius: 50%; animation: spin 1.5s linear infinite reverse; }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-thumb {
    background: #f8fafc !important;
}

.loading-text { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.5rem; }
.loading-subtext { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

@media (max-width: 600px) {
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
    .actions-bar { flex-direction: column; text-align: center; padding: 1.5rem 1rem; }
    .selection-controls { width: 100%; justify-content: center; }
    .btn-action { width: 100%; justify-content: center; }
}
