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

/* ============================================
   SME Lab - Global Styles
   ============================================ */

:root {
  --primary-dark-blue: #112A5A;
  --primary-orange: #f97316;
  --primary-green: #10B981;
  --primary-blue: #0a192f;
  --accent: #ea580c;
  --white: #ffffff;
  --light-gray: rgba(255, 255, 255, 0.05);
  --dark-gray: #f8fafc;
  --medium-gray: #cbd5e1;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --glass-bg: rgba(255, 255, 255, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  --transition: all 0.3s ease;
}

:root[data-theme="light"] {
  --primary-dark-blue: #f1f5f9;
  --primary-blue: #1e293b;
  --white: #ffffff;
  --light-gray: rgba(0, 0, 0, 0.05);
  --dark-gray: #0f172a;
  --medium-gray: #475569;
  --border-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] body {
  background-image: none;
  background-color: var(--primary-dark-blue);
}

:root[data-theme="light"] .hero {
  background-image: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--dark-gray);
}

:root[data-theme="light"] .hero h1 {
  background: none;
  color: var(--primary-blue);
  -webkit-text-fill-color: initial;
}

:root[data-theme="light"] .hero p {
  color: var(--medium-gray);
}

:root[data-theme="light"] .navbar-brand {
  color: var(--primary-blue);
}

:root[data-theme="light"] .navbar-menu a {
  color: var(--medium-gray);
}

:root[data-theme="light"] .navbar-menu a:hover,
:root[data-theme="light"] .navbar-menu a.active {
  color: var(--primary-blue);
}

:root[data-theme="light"] .sidebar {
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
}

:root[data-theme="light"] .sidebar-menu li a {
  color: var(--medium-gray);
}

:root[data-theme="light"] .sidebar-menu li a:hover,
:root[data-theme="light"] .sidebar-menu li a.active {
  color: var(--primary-blue);
  background-color: var(--light-gray);
  border-left-color: var(--primary-blue);
}

:root[data-theme="light"] .hamburger span {
  background-color: var(--primary-blue);
}

:root[data-theme="light"] footer {
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
}

:root[data-theme="light"] .footer-section h4 {
  color: var(--dark-gray);
}

:root[data-theme="light"] .footer-bottom {
  border-top-color: var(--border-color);
  color: var(--medium-gray);
}

:root[data-theme="light"] table thead {
  background-color: var(--light-gray);
}

:root[data-theme="light"] table th {
  color: var(--dark-gray);
}

:root[data-theme="light"] label[for="ai-prompt"] {
  color: var(--dark-gray) !important;
}

:root[data-theme="light"] #ai-prompt {
  background: rgba(255,255,255,0.8) !important;
  color: var(--dark-gray) !important;
  border-color: var(--border-color) !important;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  background-color: var(--primary-dark-blue);
  color: var(--dark-gray);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: radial-gradient(circle at top left, rgba(249, 115, 22, 0.08), transparent 40%), linear-gradient(135deg, #112A5A 0%, #051433 100%);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--medium-gray);
}

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

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

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--accent) 100%);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary-orange) 100%);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--primary-orange);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #ea580c;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-danger {
  background-color: var(--error);
  color: var(--white);
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  color: var(--dark-gray);
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.card-body {
  padding: 1rem 0;
}

.card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ============================================
   INPUTS & FORMS
   ============================================ */

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--dark-gray);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

select option {
  background-color: var(--primary-dark-blue);
  color: var(--dark-gray);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-gray);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================
   NAVBAR
   ============================================ */

nav {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.navbar-menu a {
  color: var(--medium-gray);
  font-weight: 500;
  transition: var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
  color: var(--primary-orange);
}

.navbar-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--white);
  margin: 5px 0;
  transition: var(--transition);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: 250px;
  background-color: #051433;
  color: var(--dark-gray);
  padding: 2rem 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-hide {
  transform: translateX(-100%);
}

.sidebar-logo {
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-left: 4px solid var(--primary-blue);
  padding-left: calc(1.5rem - 4px);
}

.sidebar-menu li a i {
  font-size: 1.25rem;
}

/* ============================================
   MAIN LAYOUT WITH SIDEBAR
   ============================================ */

.layout {
  display: flex;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  min-height: 100vh;
  background-color: var(--light-gray);
  padding: 2rem 0;
}

.page-header {
  background-color: transparent;
  padding: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  margin: 0;
}

/* ============================================
   DASHBOARD WIDGETS
   ============================================ */

.widget {
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 0.875rem;
  color: var(--medium-gray);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.widget-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-gray);
}

.widget-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background-color: transparent;
}

thead {
  background-color: var(--light-gray);
  border-bottom: 2px solid var(--border-color);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--white);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background-color: var(--light-gray);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background-color: #ECFDF5;
  color: #065F46;
}

.badge-warning {
  background-color: #FFFBEB;
  color: #B45309;
}

.badge-error {
  background-color: #FEF2F2;
  color: #991B1B;
}

.badge-info {
  background-color: #EFF6FF;
  color: #1E40AF;
}

/* ============================================
   SECTION SPACING
   ============================================ */

section {
  padding: 4rem 0;
}

section:nth-child(even) {
  background-color: var(--light-gray);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  background-color: var(--primary-dark-blue);
  background-image: linear-gradient(135deg, #112A5A 0%, #051433 100%);
  color: var(--white);
  padding: 8rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 40%);
  pointer-events: none;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .btn {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background-color: #051433;
  color: var(--medium-gray);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--white);
}

.footer-section a {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-section a:hover {
  color: var(--primary-blue);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   CHARTS (SIMPLE BARS)
   ============================================ */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 150px;
  margin: 1.5rem 0;
}

.chart-bar {
  flex: 1;
  background-color: var(--primary-blue);
  border-radius: var(--radius-sm);
  min-height: 20px;
  position: relative;
  transition: var(--transition);
}

.chart-bar:hover {
  background-color: var(--primary-orange);
}

.chart-bar.alt {
  background-color: var(--primary-orange);
}

/* ============================================
   EDITOR STYLES
   ============================================ */

.editor {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-toolbar {
  background-color: var(--light-gray);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-toolbar button {
  padding: 0.5rem 1rem;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.editor-toolbar button:hover {
  background-color: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.editor-content {
  min-height: 300px;
  padding: 1rem;
}

/* ============================================
   PREVIEW PANEL
   ============================================ */

.preview-panel {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background-color: var(--light-gray);
  margin-top: 1.5rem;
}

.preview-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--medium-gray);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-success {
  background-color: #ECFDF5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.alert-error {
  background-color: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-warning {
  background-color: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.alert-info {
  background-color: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #93C5FD;
}

/* ============================================
   CHECKLIST
   ============================================ */

.checklist {
  list-style: none;
}

.checklist li {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.checklist-icon {
  font-size: 1.5rem;
  min-width: 30px;
}

.checklist-content h4 {
  margin: 0 0 0.25rem 0;
}

.checklist-content p {
  margin: 0;
  font-size: 0.875rem;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--medium-gray);
}

.modal-close:hover {
  color: var(--dark-gray);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
    transition: var(--transition);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .navbar-menu {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .flex-col-mobile {
    flex-direction: column;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero .btn {
    width: 100%;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }

  .chart {
    height: 100px;
  }

  .widget-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  section {
    padding: 2rem 0;
  }

  .page-header {
    padding: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  input,
  textarea,
  select {
    padding: 0.625rem;
  }
}
