/**
 * IT Vision - Design Tokens & Core Layout Stylesheet
 */

:root {
  /* Dark Theme Palette (Default) */
  --bg-main: #0B1020;
  --bg-surface: #111827;
  --bg-surface-elevated: #1F2937;
  --bg-card: rgba(17, 24, 39, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(37, 99, 235, 0.5);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-primary: #2563EB;
  --accent-primary-hover: #1D4ED8;
  --accent-cyan: #06B6D4;
  --accent-purple: #7C3AED;
  --accent-emerald: #10B981;
  --accent-danger: #EF4444;

  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(16px);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --glow-shadow: 0 0 25px rgba(37, 99, 235, 0.25);

  --sidebar-width: 240px;
  --header-height: 70px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #E2E8F0;
  --bg-card: #FFFFFF;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(37, 99, 235, 0.6);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --glow-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Layout Framework */
.app-container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.main-wrapper {
  display: flex;
  flex: 1;
  padding-top: var(--header-height);
}

/* Top Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  transition: var(--transition);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.header-search {
  flex: 1;
  max-width: 600px;
  margin: 0 32px;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  transition: var(--transition);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 14px;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--border-active);
}

/* User Avatar Dropdown */
.profile-menu-container {
  position: relative;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--accent-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 8px;
  display: none;
  z-index: 100;
}

.dropdown-menu.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-main);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  flex-shrink: 0;
}

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.nav-item.active {
  color: #FFFFFF;
  background: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Content Area */
.app-content {
  flex: 1;
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Right Recommendation Rail */
.app-right-rail {
  width: 320px;
  padding: 32px 24px;
  border-left: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  justify-content: space-around;
  align-items: center;
  z-index: 50;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  gap: 4px;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .app-right-rail {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .main-wrapper {
    padding-bottom: 70px;
  }
  .app-content {
    padding: 20px 16px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
