/* --------------------------------------------------------------------------
   efeozkan.co Productivity Suite - Global Styles
   Color Palette:
     #09637E  Deep Teal       - Primary Actions
     #088395  Ocean Blue      - Accents
     #7AB2B2  Sage Blue       - Muted Elements
     #EBF4F6  Ice White       - Main Background (Light)
     #042F3C  Deepest Teal    - Background (Dark)
--------------------------------------------------------------------------- */

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

/* CSS Custom Properties */
:root {
  /* Brand Colors */
  --color-primary: #09637E;
  --color-accent: #088395;
  --color-muted: #7AB2B2;
  --color-bg: #EBF4F6;
  --color-bg-dark: #042F3C;

  /* Light Mode Tokens */
  --bg: #ffffff;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #F4FAFC;
  --bg-nav: #EBF4F6;
  --text-primary: #0d2b35;
  --text-secondary: #3d6b76;
  --text-muted: #7AB2B2;
  --text-inverse: #ffffff;
  --border: #C8E0E8;
  --border-focus: #088395;
  --shadow: 0 4px 24px rgba(9, 99, 126, 0.10);
  --shadow-lg: 0 8px 40px rgba(9, 99, 126, 0.18);
  --input-bg: #F4FAFC;

  /* Spacing */
  --nav-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Transitions */
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg: #042F3C;
  --bg-surface: #063346;
  --bg-surface-2: #083a51;
  --bg-nav: #063346;
  --text-primary: #e8f4f8;
  --text-secondary: #7AB2B2;
  --text-muted: #4a8899;
  --border: #0a4a5e;
  --border-focus: #7AB2B2;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
  --input-bg: #063346;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

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

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

/* Navbar */
.navbar {
  background: var(--bg-nav);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(9, 99, 126, 0.07);
  transition: background 0.3s ease;
}

.navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  gap: 1rem;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary) !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-brand:hover {
  color: var(--color-accent) !important;
}

.navbar-brand .brand-dot {
  color: var(--color-muted);
}

.space-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.06rem 0.16rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-nav) 78%, white 22%);
  box-shadow: 0 1px 4px rgba(9, 99, 126, 0.04);
}

.space-switcher-btn {
  width: 17px;
  height: 14px;
  border: none;
  border-radius: 999px;
  background: rgba(9, 99, 126, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  transition: var(--transition);
}

.space-switcher-btn:hover {
  background: rgba(9, 99, 126, 0.14);
  color: var(--color-primary);
}

.space-switcher-btn.disabled,
.space-switcher-btn:disabled {
  background: transparent;
  opacity: 0.35;
  cursor: default;
}

.space-switcher-label {
  min-width: 65px;
  max-width: 108px;
  padding: 0 0.24rem;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.space-nav-item {
  display: flex;
  align-items: center;
  padding-right: 0.65rem;
  margin-right: 0.15rem;
  border-right: 1px solid var(--border);
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
  flex: 1;
  margin-left: 1.5rem;
}

.nav-links>li {
  display: flex;
  align-items: center;
}

.nav-links>li:not(:last-child):not(.hidden-nav-item) {
  border-right: 1px solid var(--border);
  padding-right: 0.5rem;
  margin-right: 0.5rem;
}

.nav-links>li:has(a[style*="display: none"]) {
  display: none;
}

.nav-links a svg,
.nav-links button svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-links a:hover svg,
.nav-links button:hover svg {
  transform: translateY(-1px);
}

.nav-links a,
.nav-links button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.nav-links a:hover,
.nav-links button:hover {
  background: rgba(9, 99, 126, 0.08);
  color: var(--color-primary);
}

.nav-links a.active {
  background: rgba(9, 99, 126, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dropIn 0.18s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: block;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary) !important;
  border-radius: 0;
  min-height: 44px;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--bg-surface-2);
  color: var(--color-primary) !important;
}

.dropdown-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s;
}



/* Right section */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Dark Mode Toggle */
.dark-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.dark-toggle:hover {
  background: rgba(9, 99, 126, 0.15);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.hamburger:hover {
  background: var(--bg-surface-2);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 47, 60, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  display: block;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100dvh;
  background: var(--bg-nav);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--nav-height);
}

.mobile-drawer-header .navbar-brand {
  font-size: 1rem;
  color: var(--text-primary);
}

.drawer-close {
  width: 36px;
  height: 36px;
  background: var(--bg-surface-2);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 1.25rem 0.6rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  color: var(--text-primary) !important;
  font-size: 0.95rem;
  font-weight: 600;
  border-left: 4px solid transparent;
  transition: var(--transition);
  min-height: 52px;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: var(--bg-surface-2);
  color: var(--color-primary) !important;
  border-left-color: var(--color-primary);
}

.mobile-nav-link.active {
  background: rgba(9, 99, 126, 0.12);
  color: var(--color-primary) !important;
  border-left-color: var(--color-primary);
}

.mobile-nav-link .icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 16px !important;
  /* Explicit px instead of rem to prevent scaling calculation issues */
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  background: var(--input-bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  min-height: 44px;
  -webkit-text-size-adjust: 100%;
}

.form-control::placeholder {
  font-size: 16px !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Fix for autofill font size and family consistency */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset !important;
  transition: background-color 5000s ease-in-out 0s;
  font-size: 16px !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.18);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(9, 99, 126, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.btn-danger {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.btn-danger:hover {
  background: #a93226;
}

.btn-full {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.badge-primary {
  background: rgba(9, 99, 126, 0.15);
  color: var(--color-primary);
}

.badge-success {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.badge-warning {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
}

.badge-danger {
  background: rgba(192, 57, 43, 0.15);
  color: #c0392b;
}

/* Toast / Flash */
.flash-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
}

.flash.success {
  border-left: 4px solid #27ae60;
}

.flash.error {
  border-left: 4px solid #c0392b;
}

.flash.info {
  border-left: 4px solid var(--color-accent);
}

.flash.warning {
  border-left: 4px solid #e67e22;
}

.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.flash-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Auth Pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.auth-logo p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.module-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.module-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.module-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Coming Soon */
.coming-soon-wrap {
  text-align: center;
  padding: 5rem 2rem;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.coming-soon-wrap h1 {
  font-size: 2rem;
  color: var(--color-primary);
}

.coming-soon-wrap p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Utility */
.text-center {
  text-align: center;
}

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

.text-primary {
  color: var(--color-primary);
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: 0.5rem;
}

.w-full {
  width: 100%;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .navbar {
    padding: 0 1rem;
  }

  .main-content {
    padding: 1.25rem 1rem;
  }

  .auth-card {
    padding: 2rem 1.25rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .flash-container {
    left: 1rem;
    right: 1rem;
    max-width: 100%;
  }

  .space-switcher {
    padding: 0.05rem 0.14rem;
  }

  .space-switcher-label {
    min-width: 65px;
    max-width: 96px;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none !important;
  }

  .mobile-nav-overlay,
  .mobile-nav-drawer {
    display: none !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}
