/* ==========================================================================
   FICIT Apps - Directory Index Styling
   ========================================================================== */

:root {
  --bg-app: #0b0f19;
  --bg-header: rgba(15, 23, 42, 0.85);
  --bg-card: #131c2e;
  --bg-card-header: #1a253c;
  --bg-hover: #1e2d4a;
  --bg-input: #1a253c;
  --bg-badge: #1e293b;
  --border-color: #22324f;
  --border-subtle: #1a273f;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --accent-glow: rgba(56, 189, 248, 0.15);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'SFMono-Regular', Menlo, Monaco, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  max-width: 520px;
  justify-content: flex-end;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

#file-search {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

#file-search:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

#file-search::placeholder {
  color: var(--text-dim);
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.search-clear-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.stats-badge {
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.main-content {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.content-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-weight: 500;
}

.crumb-link:hover {
  color: var(--accent-primary);
  background: var(--bg-hover);
}

.crumb-separator {
  color: var(--text-dim);
  user-select: none;
}

.crumb-current {
  color: var(--text-main);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

th {
  background: var(--bg-card-header);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

th a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

th a:hover {
  color: var(--accent-primary);
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-hover);
}

tr.parent-dir-row td {
  background: rgba(56, 189, 248, 0.03);
}

tr.parent-dir-row:hover td {
  background: var(--bg-hover);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  word-break: break-all;
}

.file-link:hover {
  color: var(--accent-primary);
}

.file-ext-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.file-ext-tag.exe { color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.1); }
.file-ext-tag.ps1 { color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); background: rgba(96, 165, 250, 0.1); }
.file-ext-tag.bat { color: #34d399; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.1); }
.file-ext-tag.sh  { color: #10b981; border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.1); }
.file-ext-tag.zip { color: #fb923c; border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.1); }
.file-ext-tag.dir { color: #facc15; border-color: rgba(250, 204, 21, 0.3); background: rgba(250, 204, 21, 0.1); }

.file-size-cell, .file-date-cell {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.file-date-cell {
  color: var(--text-muted);
}

.file-size-cell {
  color: var(--text-dim);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

.btn-download {
  color: var(--accent-primary);
}

.empty-search-row {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-dim);
}

.empty-search-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.empty-search-icon {
  width: 36px;
  height: 36px;
  color: var(--text-dim);
}

.app-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-app);
  padding: 1.2rem 0;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.divider {
  color: var(--border-color);
}

.shortcut-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--accent-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    max-width: none;
  }
  .search-wrapper {
    max-width: none;
  }
  .file-date-cell, .action-cell {
    display: none;
  }
}
