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

:root {
    /* Dull grey-blue palette matching feedback.iswappp.com */
    --bg:       #181e25;
    --surface:  #1e252e;
    --surface2: #242c36;
    --border:   #343f4c;
    --accent:   #5b7593;
    --accent2:  #4f6682;
    --text:     #e0e6ed;
    --muted:    #8b9cad;
    
    /* Utility colors */
    --success:  #4ade80;
    --danger:   #f87171;
    --radius:   6px; /* Slightly smoother for the file view */
    
    /* File Icon Colors */
    --c-folder:  #d97706; /* Warm amber */
    --c-archive: #38bdf8; /* Ocean blue */
    --c-image:   #f472b6; /* Soft pink */
    --c-doc:     #34d399; /* Emerald */
    --c-code:    #a78bfa; /* Violet */
    --c-db:      #f59e0b; /* Golden gold */
    --c-generic: #94a3b8; /* Cool slate */
}

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Glowing Ambient Blurs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 600px; 
    height: 600px;
    background: rgba(91, 117, 147, 0.04);
    top: -150px; 
    left: -150px;
}
body::after {
    width: 500px; 
    height: 500px;
    background: rgba(79, 102, 130, 0.04);
    bottom: -100px; 
    right: -100px;
}

/* Large Main Explorer Card */
.card {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 960px;
    box-shadow: 0 10px 30px rgba(15, 20, 25, 0.5);
    animation: fadeUp .55s cubic-bezier(.23, 1, .32, 1) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.card-header { 
    text-align: center; 
    margin-bottom: 2.5rem; 
}

.logo-icon {
    width: 60px; 
    height: 60px;
    border-radius: var(--radius);
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .6rem;
    letter-spacing: -0.025em;
}

.card-header p { 
    color: var(--muted); 
    font-size: .95rem; 
    line-height: 1.6; 
}

/* Alert Banner */
.alert {
    display: none;
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    align-items: center;
    gap: .6rem;
    border: 1px solid transparent;
    animation: fadeUp .3s ease;
}
.alert.show { 
    display: flex; 
}
.alert-success {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
    color: var(--success);
}
.alert-error {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
    color: var(--danger);
}

/* Explorer Interface Area */
.explorer-container {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Toolbar: Breadcrumbs & Search */
.explorer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(24, 30, 37, 0.4);
}

/* Breadcrumbs Path */
.breadcrumb-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text);
    cursor: default;
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--border);
    user-select: none;
}

/* Search Wrapper */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

#searchInput {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    padding: .65rem 2.5rem .65rem 2.4rem;
    outline: none;
    transition: border-color .2s, box-shadow 0.2s;
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 117, 147, 0.15);
}

.clear-search {
    position: absolute;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.clear-search:hover {
    background: var(--surface2);
    color: var(--text);
}

.clear-search.show {
    display: flex;
}

/* Files View Area */
.files-view {
    position: relative;
    min-height: 250px;
    max-height: 600px;
    overflow-y: auto;
}

/* Loading & Empty States */
.loader-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--muted);
    font-size: 0.95rem;
    gap: 1rem;
}

.loader-wrap.show {
    display: flex;
}

.spinner {
    width: 32px; 
    height: 32px;
    border: 3px solid rgba(91, 117, 147, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--muted);
}

.empty-state.show {
    display: flex;
}

.empty-icon {
    color: var(--border);
    margin-bottom: 1.25rem;
}

.empty-state h3 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 320px;
}

/* Files Table */
.files-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    display: table;
}

.files-table.hidden {
    display: none;
}

.files-table th {
    background: rgba(24, 30, 37, 0.2);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.files-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Rows with beautiful transitions */
.files-table tbody tr {
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
}

.files-table tbody tr:hover {
    background: rgba(91, 117, 147, 0.06);
}

.files-table tbody tr:active {
    background: rgba(91, 117, 147, 0.1);
}

/* Column formatting */
.col-name { 
    width: 55%; 
}
.col-size { 
    width: 15%; 
    text-align: right; 
    font-variant-numeric: tabular-nums;
}
.col-mtime { 
    width: 20%; 
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
.col-actions { 
    width: 10%; 
    text-align: center; 
}

/* Cell contents */
.name-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.name-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.name-cell svg {
    flex-shrink: 0;
}

/* Color coding icons */
.icon-folder { color: var(--c-folder); }
.icon-archive { color: var(--c-archive); }
.icon-image { color: var(--c-image); }
.icon-doc { color: var(--c-doc); }
.icon-code { color: var(--c-code); }
.icon-db { color: var(--c-db); }
.icon-generic { color: var(--c-generic); }

/* Download Actions */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.btn-action:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #f8fafc;
}

.btn-action:active {
    transform: scale(0.96);
}

.btn-action svg {
    transition: transform 0.2s;
}

.btn-action:hover svg {
    transform: translateY(1px);
}

/* Footer styling */
.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    color: var(--muted);
    font-size: .8rem;
    text-align: center;
    letter-spacing: 0.025em;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card { 
        padding: 1.5rem 1rem; 
    }
    
    .card-header h1 { 
        font-size: 1.5rem; 
    }
    
    .explorer-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrap {
        min-width: 100%;
    }
    
    /* Hide some columns to make it look clean on mobile */
    .col-mtime, .col-size {
        display: none;
    }
    
    .files-table th.col-mtime, 
    .files-table th.col-size,
    .files-table td:nth-child(2), 
    .files-table td:nth-child(3) {
        display: none;
    }
    
    .col-name {
        width: 80%;
    }
    .col-actions {
        width: 20%;
    }
}
