/* css/main.css */

/* Google Fonts Imports */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Outfit:wght@300..900&display=swap');

:root {
  /* Color System */
  --color-primary: #4F46E5;        /* Premium Indigo */
  --color-primary-light: #EEF2FF;
  --color-accent: #F97316;         /* Playful Orange */
  --color-accent-light: #FFF7ED;
  --color-success: #10B981;        /* Emerald Mint */
  --color-success-light: #ECFDF5;
  --color-warning: #F59E0B;        /* Golden Yellow */
  --color-warning-light: #FEF3C7;
  --color-danger: #EF4444;         /* Coral Red */
  --color-danger-light: #FEF2F2;
  
  --color-bg-main: #F8FAFC;        /* Soft Slate */
  --color-bg-card: #FFFFFF;
  --color-text-main: #1E293B;      /* Dark Slate */
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;

  /* Typography */
  --font-family-base: 'Outfit', sans-serif;
  --font-family-heading: 'Fredoka', sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(79, 70, 229, 0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  --shadow-card: 0 15px 30px -10px rgba(0, 0, 0, 0.04), 0 0 1px 1px rgba(0, 0, 0, 0.01);
  --shadow-button: 0 4px 10px rgba(79, 70, 229, 0.15);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Layout */
  --sidebar-width: 260px;
  --top-bar-height: 80px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family-base);
  color: var(--font-family-base);
  background-color: var(--color-bg-main);
  color: var(--color-text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.25;
}

p {
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Base Layout Wrapper */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* 1. Sidebar Nav Styling */
.sidebar-panel {
  width: var(--sidebar-width);
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-logo-area {
  height: var(--top-bar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo-img {
  width: 42px;
  height: 42px;
  background-color: white;
  border-radius: 50%;
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
  animation: float-anim 3s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-family-heading);
  font-size: 19px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: var(--transition-normal);
}

.sidebar-nav a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.sidebar-nav a.active {
  background-color: var(--color-primary);
  color: var(--color-bg-card);
  box-shadow: var(--shadow-button);
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.designer-credit {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* 2. Main Content Wrapper */
.content-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

/* Top bar navigation */
.top-bar-header {
  height: var(--top-bar-height);
  background-color: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

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

.role-switcher-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--color-primary-light);
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--color-primary);
}

.role-switcher-card label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}

.role-selector {
  border: none;
  background: transparent;
  font-weight: 700;
  color: var(--color-primary);
  outline: none;
  cursor: pointer;
  padding-right: 8px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Main scrollable body area */
.main-body-scrollable {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Animations */
@keyframes float-anim {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

@keyframes shake {
  0%, 100% { transform: scale(1); }
  25% { transform: rotate(-5deg) scale(1.05); }
  75% { transform: rotate(5deg) scale(1.05); }
}

.shake-anim {
  animation: shake 0.4s ease-in-out;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsiveness Settings */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 80px;
  }
  .logo-text, .designer-credit, .sidebar-footer {
    display: none;
  }
  .sidebar-logo-area {
    justify-content: center;
    padding: 0;
  }
  .nav-label {
    display: none;
  }
  .nav-icon {
    font-size: 22px;
  }
  .sidebar-nav a {
    justify-content: center;
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  .sidebar-panel {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
  }
  .sidebar-panel.open {
    left: 0;
  }
  .sidebar-logo-area {
    display: flex !important;
    justify-content: flex-start !important;
    padding: 0 20px !important;
  }
  .sidebar-nav {
    flex-direction: column !important;
    padding: 24px 16px !important;
    gap: 0 !important;
    overflow-y: auto;
    white-space: normal !important;
  }
  .sidebar-nav a {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    margin-bottom: 4px;
    box-sizing: border-box;
  }
  .nav-label {
    display: inline-block !important;
    font-size: 14px;
  }
  .nav-divider {
    display: block !important;
    margin: 12px 0;
    border: none;
    border-top: 1px solid var(--color-border);
  }
  .logo-text, .designer-credit, .sidebar-footer {
    display: block !important;
  }
  .top-bar-header {
    padding: 0 16px;
    padding-left: 72px; /* Make space for hamburger toggle button */
    flex-wrap: wrap;
    height: auto;
    min-height: var(--top-bar-height);
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 12px;
  }
  .main-body-scrollable {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .date-widget {
    display: none !important;
  }
  .top-bar-header {
    justify-content: space-between;
  }
}
