/* assets/css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-app: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-stage: #0f172a;
  --border: rgba(255, 255, 255, 0.06);
  --primary: #0ea5e9;
  --primary-glow: rgba(14, 165, 233, 0.2);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.glow-edge {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: -1;
  filter: blur(60px);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Authentication Interface */
.auth-box {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.user-pill {
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.user-tier {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.user-email {
  font-size: 0.85rem;
  color: white;
  margin: 4px 0 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.btn-logout:hover { color: #f87171; }

.btn-auth {
  width: 100%;
  padding: 0.75rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--primary);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-auth:hover { background: var(--primary); color: white; border-color: transparent; }

.auth-hint { 
  font-size: 0.65rem; 
  color: var(--text-muted); 
  text-align: center; 
  margin-top: 8px;
  font-weight: 500;
}

/* ----------------------------------------------------------------
   AUTHENTICATION MODAL REDESIGN
   ---------------------------------------------------------------- */
.auth-form { display: none; }
.auth-form.active { 
    display: block; 
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    max-width: 420px;
    width: 92%;
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem !important; /* Condense vertical space */
    border-radius: 20px !important;
}

.auth-input-group {
    margin-bottom: 1.25rem; /* Tighten inputs */
}

.auth-input-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.auth-forms input {
    display: block;
    width: 100%;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-forms input:focus {
    border-color: var(--primary);
    background: #020617;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
    margin-left: 5px;
}

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

.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-logo span { color: var(--primary); }

.sys-dot {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pulse {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.sidebar-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 2rem;
}

.search-icon { position: absolute; left: 12px; top: 10px; color: var(--text-muted); font-size: 0.9rem; }

#format-search {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

#format-search:focus { border-color: var(--primary); }

.list-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}

/* Format List Styling */
.format-list { display: flex; flex-direction: column; gap: 4px; }

.format-li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.format-li:hover { background: rgba(255,255,255,0.03); }

.format-li.active {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.3);
}

.format-li .ext {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  min-width: 45px;
}

.format-li .desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.format-li.active .ext { color: var(--primary); }

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-footer a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.sidebar-footer a:hover { color: white; }

/* Workspace Styling */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-stage);
}

.workspace-header {
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-header h1 { 
    font-size: 2rem; 
    font-weight: 800; 
    letter-spacing: -1.5px; 
    background: linear-gradient(135deg, white 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 40px rgba(14, 165, 233, 0.2);
}
.workspace-header p { font-size: 0.85rem; color: var(--text-dim); }

.btn-help {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-help:hover { border-color: var(--text-dim); }

.stage {
  flex: 1;
  padding: 0 3rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.drop-stage {
  height: 380px;
  max-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.08) 0%, rgba(15, 23, 42, 0.3) 100%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8);
}

.drop-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 40px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(14, 165, 233, 0.3), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: all 0.5s;
}

.drop-stage:hover {
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.15) 0%, rgba(15, 23, 42, 0.5) 100%);
  transform: translateY(-4px);
  box-shadow: 0 50px 120px -30px rgba(0,0,0,0.9), 0 0 40px var(--primary-glow);
}

.drop-stage:hover::before {
    background: linear-gradient(135deg, var(--primary), transparent, var(--primary));
}

.stage-content { text-align: center; }
.stage-icon { font-size: 3rem; margin-bottom: 1.5rem; opacity: 0.8; }
.drop-stage h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.drop-stage p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }

.accepted-list {
  display: flex;
  justify-content: center;
  gap: 10px;
  list-style: none;
}

.accepted-list li {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  color: var(--text-muted);
}

/* Dashboard Controls */
.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.btn-primary {
  padding: 1rem 2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-primary:disabled { opacity: 0.2; cursor: not-allowed; box-shadow: none; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 15px 30px var(--primary-glow); }

.live-status { flex: 1; display: none; }
.status-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.8rem; font-weight: 600; }
.bar { height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--primary); transition: width 0.3s; }

.success-box {
  flex: 1;
  display: none;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  align-items: center;
  justify-content: space-between;
}

.success-meta { display: flex; align-items: center; gap: 15px; }
.check-icon { width: 32px; height: 32px; background: var(--success); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.success-meta h3 { font-size: 1rem; }
.success-meta p { font-size: 0.75rem; color: var(--text-dim); }

.btn-dl { background: white; color: black; padding: 0.6rem 1.25rem; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.8rem; transition: all 0.2s; }
.btn-dl:hover { transform: scale(1.05); }

/* Scrollbar Handling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar { width: 260px; }
}
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-content { height: 200px; }
  .workspace-header { padding: 1.5rem; }
  .stage { padding: 0 1.5rem 1.5rem 1.5rem; }
}

/* Elite Modal System */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; z-index: 2000;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-card {
  background: linear-gradient(165deg, var(--bg-sidebar), #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8), 0 0 40px var(--primary-glow);
  padding: 3.5rem; border-radius: 32px; max-width: 600px; width: 92%;
  max-height: 85vh; overflow-y: auto;
  transform: scale(0.95) translateY(20px); transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active .modal-card { transform: scale(1) translateY(0); }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; }

.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: white; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }

/* Document Layouts */
.doc-section { margin-bottom: 2.5rem; }
.doc-section h4 { 
  font-size: 0.75rem; font-weight: 800; color: var(--primary); 
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; 
  display: flex; align-items: center; gap: 8px;
}

.doc-section h4::before { content: ""; width: 4px; height: 12px; background: var(--primary); border-radius: 2px; }

.doc-section p { font-size: 0.95rem; color: var(--text-dim); line-height: 1.7; }

.doc-section code { 
  display: block; background: #020617; padding: 1.25rem; 
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; 
  font-size: 0.85rem; margin-top: 1rem; color: var(--primary); 
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.doc-section ul { list-style: none; margin-top: 1rem; }
.doc-section li { 
  font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.75rem; 
  padding-left: 1.5rem; position: relative;
}

.doc-section li::before { 
  content: "→"; position: absolute; left: 0; color: var(--primary); font-weight: 800; 
}

.doc-section strong { color: white; font-weight: 600; }

/* ================================================================
   INDUSTRIAL RESPONSIVENESS SYSTEM (MOBILE-FIRST)
   ================================================================ */
@media (max-width: 960px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .sidebar {
        width: 100% !important;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(10px);
    }

    .sidebar-header {
        padding: 1rem;
    }

    .auth-box {
        padding: 0 1rem 1rem 1rem;
    }

    .sidebar-content {
        padding: 0.5rem 1rem 1rem 1rem;
        max-height: none;
    }

    .search-box {
        margin-bottom: 1rem;
    }

    .list-label {
        margin-bottom: 0.5rem;
        font-size: 0.6rem;
    }

    /* Transform format list into horizontal pills for mobile */
    .format-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
        scrollbar-width: none; /* Hide scrollbar for clean pill look */
    }

    .format-list::-webkit-scrollbar { display: none; }

    .format-li {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 16px;
        background: rgba(255,255,255,0.03);
    }

    .format-li .desc { display: none; } /* Hide descriptions on mobile pill view */

    .main-terminal {
        width: 100% !important;
        padding: 1.5rem 1rem !important;
        height: auto;
        overflow: visible;
    }

    .workspace-header {
        padding: 0 0 1.5rem 0;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }

    .workspace-header h1 { font-size: 1.5rem; letter-spacing: -1px; }

    .stage {
        padding: 0;
    }

    .drop-stage {
        height: 300px;
        border-radius: 24px;
        margin-bottom: 1.5rem;
    }

    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .btn-primary {
        width: 100%;
        padding: 1.25rem;
    }

    .modal-card {
        padding: 1.5rem !important;
        border-radius: 20px !important;
        width: 95% !important;
    }

    .modal-header { margin-bottom: 1.5rem; }
}

@media (max-width: 480px) {
    .workspace-header h1 { font-size: 1.25rem; }
    .drop-stage { height: 260px; }
    .stage-icon { font-size: 2rem; }
}
