/* ============================================================
   SDBA MASTER STYLE — V5.8.5 (UI PERFECTION & OVERLAP FIX)
   Tecnologias — Dakila Bahia
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --gold: #D4AF37;
    --gold-dim: rgba(212, 175, 55, 0.1);
    --gold-glow: rgba(212, 175, 55, 0.2);
    --bg-void: #030407;
    --bg-card: rgba(15, 18, 25, 0.9);
    --bg-hover: rgba(212, 175, 55, 0.1);
    --border: rgba(255, 255, 255, 0.1);
    --font-data: 'JetBrains Mono', monospace;
    --font-main: 'Poppins', sans-serif;
    --topbar-height: 70px;
    --sidebar-w: 75px;
    --sidebar-expand: 260px;
    --bottom-nav-height: 80px;
    --radius-pill: 50px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background: var(--bg-void); color: #fff; font-family: var(--font-main);
    overflow-x: hidden; padding-top: var(--topbar-height);
    display: flex; flex-direction: column; min-height: 100vh;
}

@media (min-width: 993px) { body { padding-left: var(--sidebar-w); } }

.ls-2 { letter-spacing: 2px; }
.uppercase { text-transform: uppercase; }
.text-gold { color: var(--gold) !important; }
.centered-text { text-align: center; }

/* --- BUTTONS --- */
.btn-sdba {
    height: 44px; padding: 0 25px; border-radius: var(--radius-pill);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; cursor: pointer; transition: var(--transition); border: none;
    text-decoration: none !important;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), #b8860b); color: #000; }
.btn-outline-sdba { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); color: #fff; }

/* --- SHELL: TOPBAR --- */
.navbar-sdba {
    height: var(--topbar-height); background: rgba(3, 4, 7, 0.98);
    backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 25px; position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
}
.topbar-logo { height: 48px; filter: drop-shadow(0 0 5px var(--gold-glow)); }
.topbar-phrase-container { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; }
.phrase-center {
    font-family: var(--font-data); font-weight: 900; font-size: 0.9rem; letter-spacing: 5px;
    background: linear-gradient(90deg, #fff 0%, var(--gold) 50%, #fff 100%);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: textShine 5s linear infinite; text-transform: uppercase;
}
@keyframes textShine { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

.topbar-right { display: flex; align-items: center; gap: 15px; z-index: 10001; }

.notif-btn {
    width: 42px; height: 42px; border-radius: 50% !important; background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border); color: var(--gold); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s; font-size: 18px; text-decoration: none !important;
    position: relative; overflow: hidden;
}
.notif-btn::before, .notif-btn::after { content: none !important; }
.notif-btn:hover { border-color: var(--gold); background: var(--bg-hover); box-shadow: 0 0 12px var(--gold-dim); }

.user-pill {
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
    padding: 4px 16px 4px 4px; border-radius: var(--radius-pill);
    display: flex; align-items: center; gap: 12px; height: 42px; cursor: pointer;
    text-decoration: none !important;
}
.avatar-top { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--gold); object-fit: cover; }
.user-pill span { font-size: 0.8rem; font-weight: 700; color: #fff; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- SHELL: SIDEBAR (PC) --- */
.sidebar-sdba {
    position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--bg-void); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 20px 0; transition: width 0.3s ease;
    z-index: 9000; overflow: hidden;
}
.sidebar-sdba:hover { width: var(--sidebar-expand); box-shadow: 15px 0 40px rgba(0,0,0,0.7); }
.nav-link-sdba {
    display: flex; align-items: center; height: 54px; padding: 0 25px;
    color: #cbd5e1; text-decoration: none !important; white-space: nowrap; position: relative;
}
.nav-link-sdba i { font-size: 20px; min-width: 24px; text-align: center; color: var(--gold); margin-right: 25px; }
.nav-link-sdba span { opacity: 0; transition: 0.3s; font-weight: 600; }
.sidebar-sdba:hover .nav-link-sdba span { opacity: 1; }
.nav-link-sdba.active { background: var(--bg-hover); color: #fff; }

/* --- SHELL: MOBILE NAV --- */
.bottom-nav { display: none; } 

@media (max-width: 992px) {
    .sidebar-sdba { display: none !important; }
    .bottom-nav { 
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        height: var(--bottom-nav-height); background: rgba(3, 4, 7, 0.98); 
        backdrop-filter: blur(20px); border-top: 1px solid var(--border-gold); 
        justify-content: space-around; align-items: center; z-index: 10000;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-item { display: flex; align-items: center; justify-content: center; flex: 1; height: 100%; text-decoration: none !important; }
    .bottom-item span { display: none; }
    .bottom-item i { font-size: 28px; color: rgba(212, 175, 55, 0.25); transition: 0.3s; }
    .bottom-item.active i { color: var(--gold); filter: drop-shadow(0 0 5px var(--gold)); transform: none; }
    
    .main-content { margin-left: 0; padding: 15px; padding-bottom: 150px !important; }
    .topbar-phrase-container { display: none; }
}

/* --- HUB SCREEN --- */
.welcome-section { padding: 40px 0 20px; text-align: center; }
.welcome-section h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 5px; }
.uplink-status { color: var(--gold); font-family: var(--font-data); font-size: 0.8rem; letter-spacing: 3px; font-weight: 700; }

.news-section { padding: 30px; margin-bottom: 30px; text-align: center; }
.news-title { font-size: 0.8rem; font-weight: 800; color: var(--gold); letter-spacing: 4px; display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 25px; }
.news-item { padding: 20px 0; border-bottom: 1px solid var(--border); text-align: center; }
.news-item h6 { color: #fff; font-weight: 700; margin-bottom: 5px; font-size: 1.1rem; }
.news-item p { color: #fff; font-size: 0.9rem; line-height: 1.6; max-width: 800px; margin: 0 auto 8px; text-align: center; }
.news-date { font-family: var(--font-data); font-size: 0.7rem; color: var(--gold); font-weight: 700; }

.hub-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 20px; }
.hub-card {
    flex: 1 1 220px; max-width: 320px; padding: 35px 20px; 
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 15px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
    cursor: pointer; transition: var(--transition); text-decoration: none !important;
}
.hub-card:hover { border-color: var(--gold); transform: translateY(-5px); background: var(--bg-hover); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.hub-card i { font-size: 36px; color: var(--gold); }
.hub-card h5 { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0; }
.hub-card p { color: #fff; font-size: 0.85rem; margin: 0; }

@media (max-width: 576px) {
    .hub-card { flex: 1 1 140px; padding: 25px 15px; }
    .hub-card i { font-size: 28px; }
    .hub-card h5 { font-size: 0.9rem; }
    .hub-card p { display: none; }
}

/* --- GLASS PANELS & UTILS --- */
.glass-panel { background: rgba(15, 18, 25, 0.6); backdrop-filter: blur(15px); border: 1px solid var(--border); border-radius: 20px; }
.form-control-sdba { background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: #fff; padding: 12px; border-radius: 12px; width: 100%; }
.loading-state { text-align: center; padding: 100px 0; color: #555; font-family: var(--font-data); letter-spacing: 3px; font-size: 0.8rem; }

/* --- 17. UPLOAD SCREEN --- */
.upload-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
}

.drop-area {
    background: rgba(0,0,0,0.3);
    border: 2px dashed var(--border);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.drop-area:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
}

.preview-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.preview-item {
    aspect-ratio: 1/1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item i {
    font-size: 24px;
    color: var(--gold);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255,0,0,0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
}

/* Tag Chips */
.tags-input-container {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--border-gold);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-chip i { cursor: pointer; }

.thumb-preview-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 15px;
}

.thumb-preview-box img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 992px) {
    .upload-grid { grid-template-columns: 1fr; }
}

/* --- 18. UPLOAD REFINEMENTS (MOBILE FIRST) --- */
.preview-item {
    width: 100%;
    aspect-ratio: 16/9; /* Larger for better visibility */
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: grab;
}

.preview-item:active { cursor: grabbing; }

.preview-media-box {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.preview-media-box img { width: 100%; height: 100%; object-fit: cover; }
.preview-media-box i { font-size: 32px; color: var(--gold); }

.preview-info-bar {
    background: rgba(0,0,0,0.8);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.file-name-label {
    font-size: 0.7rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    font-family: var(--font-data);
}

.reorder-controls {
    display: flex;
    gap: 8px;
}

.reorder-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.reorder-btn:hover { color: var(--gold); }

.thumb-preview-box {
    position: relative;
    border: 2px solid var(--border-gold);
}

.thumb-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default */
    transition: object-position 0.2s;
}

/* Helper to indicate draggable */
.preview-item.dragging {
    opacity: 0.5;
    border: 2px solid var(--gold);
}

.preview-area {
    grid-template-columns: 1fr; /* List view is better for reordering on mobile */
    gap: 15px;
}

/* --- 19. REFINEMENT: UPLINK UI --- */
.gold-range {
    accent-color: var(--gold);
    background: rgba(255,255,255,0.05);
    height: 6px;
    border-radius: 5px;
}

.gold-range::-webkit-slider-thumb {
    background: var(--gold);
    border: 2px solid #000;
    box-shadow: 0 0 10px var(--gold-glow);
}

.preview-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-item {
    cursor: grab;
    user-select: none;
    touch-action: none; /* Crucial for touch drag */
}

.preview-item:active { cursor: grabbing; }

.file-info-name {
    font-family: var(--font-data);
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
