/* ==========================================================================
   AI Photo Studio - Shell (Shared Layout) Styles
   Extracted from duplicated inline styles across all pages.
   Header, Tab Bar, Footer, Language Toggle, Utility Helpers.
   ========================================================================== */


/* ===== Utility Helpers ===== */

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background-color: currentColor;
}


/* ===== Header ===== */

.shell-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header) !important;
}

.shell-header .project-context-dropdown {
  position: relative;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border-subtle);
}

.shell-header .project-context-trigger {
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all var(--transition-fast);
  position: relative;
}

.shell-header .project-context-trigger:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shell-header .project-context-trigger:active {
  transform: translateY(0);
}

.shell-header .project-context-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-header .project-context-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 9999px;
  font-weight: var(--font-weight-medium);
}

.shell-header .project-context-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  margin-top: 8px;
  width: 288px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-fixed);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.shell-header .project-context-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.shell-header .project-context-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.shell-header .project-context-menu-header span {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.shell-header .project-context-menu-list {
  padding: 4px 0;
  max-height: 256px;
  overflow-y: auto;
}

.shell-header .project-context-menu-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
}

.shell-header .project-context-menu-footer button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  cursor: pointer;
}

.shell-header .project-context-menu-footer button:hover {
  background: var(--bg-tertiary);
}

.shell-header .recent-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  border-left: 2px solid transparent;
}

.shell-header .recent-project-item:hover {
  background: var(--bg-tertiary);
  border-left-color: var(--brand-accent);
}

.shell-header .recent-project-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--brand-accent);
}

.shell-header .recent-project-item.active::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--brand-accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.shell-header .recent-project-cover {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

:root {
  --cover-gradient-wedding: linear-gradient(135deg, #52525b, #3f3f46);
  --cover-gradient-portrait: linear-gradient(135deg, #404040, #262626);
  --cover-gradient-event: linear-gradient(135deg, #26573a, #bbf7d0);
  --cover-gradient-commercial: linear-gradient(135deg, #3f3f46, #71717a);
  --cover-gradient-other: linear-gradient(135deg, #52525b, #d4d4d8);
}

.shell-header .recent-project-info {
  flex: 1;
  min-width: 0;
}

.shell-header .recent-project-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-header .recent-project-client {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ===== Tab Navigation Bar ===== */

.shell-tab-bar {
  height: var(--tab-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.shell-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out-expo), background var(--duration-fast) var(--ease-out-expo);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.shell-tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.shell-tab.active {
  color: var(--brand-accent);
  font-weight: var(--font-weight-semibold);
  background: rgba(255, 255, 255, 0.06);
}

.shell-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--brand-accent);
  border-radius: 1px 1px 0 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.50);
}


/* ===== Footer ===== */

.shell-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}


/* ===== Language Radio Toggle ===== */

.lang-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.lang-radio label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-radio input[type="radio"]:checked + label {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.lang-radio label:hover {
  color: var(--text-secondary);
}


/* ===== Responsive ===== */

@media (max-width: 640px) {
  .shell-footer .flex.items-center.gap-3 {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
  }
  .shell-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shell-tab-bar::-webkit-scrollbar {
    display: none;
  }
  .shell-tab {
    padding: 0 12px;
    flex-shrink: 0;
  }
}

/* ===== Tablet Breakpoint ===== */
@media (max-width: 1024px) {
  :root {
    --header-height: 48px;
    --tab-height: 40px;
  }
}

/* ===== Mobile Breakpoint ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 44px;
    --tab-height: 40px;
  }
}
