/**
 * OMC v2 - Customer Portal Styles
 * 
 * Custom styles for the SCANADO customer portal
 * Based on Fomantic-UI
 */

/* Font ScanadoSans: Bould (atipo)
++++++++++++++++++++++++++++++++++++ 
*/
@font-face {
  font-family: "ScanadoSans";
  src:
    local(""),
    url("/assets/ext/fonts/Bould/Bould-Medium.woff2?v19a") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ScanadoSans";
  src:
    local(""),
    url("/assets/ext/fonts/Bould/Bould-Bold.woff2?v19a") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* Font ScanadoMono: JetBrainsMono
++++++++++++++++++++++++++++++++++++ 
*/
@font-face {
  font-family: "ScanadoMono";
  src:
    local(""),
    url("/assets/ext/fonts/Bould/Bould-Regular.woff2?v19a") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ScanadoMono";
  src:
    local(""),
    url("/assets/ext/fonts/Bould/Bould-Bold.woff2?v19a") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* =====================
   VARIABLES
   ===================== */
:root {
  /* colors */
  --omc-primary: #2185d0;
  --omc-primary-dark: #1a69a4;
  --omc-secondary: #00b5ad;
  --omc-success: #21ba45;
  --omc-warning: #f2711c;
  --omc-error: #db2828;
  --omc-info: #31ccec;

  --omc-text: #333333;
  --omc-text-light: #666666;
  --omc-text-muted: #999999;

  --omc-bg-light: #f8f9fa;
  --omc-bg-dark: #1b1c1d;

  --omc-border: #e0e0e0;
  --omc-border-light: #f0f0f0;

  /* fonts */
  --s5o-f-text: "ScanadoSans", sans-serif;
  --s5o-f-text-cond: "ScanadoSans", sans-serif;
  --s5o-f-text-mono: "ScanadoMono", monospace;
  --s5o-f-text-serif: "ScanadoDisplay", "ScanadoSans", sans-serif;

  --omc-nav-height: 50px;
  --omc-footer-height: 60px;
}

/* =====================
   BASE STYLES
   ===================== */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--s5o-f-text), sans-serif;
  font-feature-settings: "tnum" !important;
  font-size: 16px;
  font-weight: 400;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--omc-bg-light);
  color: var(--omc-text);
  font-family: var(--s5o-f-text), sans-serif;
  font-feature-settings: "tnum" !important;
  font-size: 16px;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
p {
  font-family: var(--s5o-f-text), sans-serif;
}

pre,
code,
samp {
  font-family: var(--s5o-f-mono), monospace;
}

/* Main content area */
#main-content {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Navigation spacer */
.nav-spacer {
  height: var(--omc-nav-height);
}

/* =====================
   SIDEBAR NAVIGATION
   ===================== */
:root {
  --omc-sidebar-width: 260px;
}

/* Sidebar Menu */
#main-sidebar {
  background-color: var(--omc-bg-dark) !important;
  width: var(--omc-sidebar-width) !important;
}

#main-sidebar .brand-item {
  padding: 1.25rem 1rem !important;
}

#main-sidebar .brand-link {
  display: flex;
  align-items: center;
  color: white !important;
  text-decoration: none;
}

#main-sidebar .sidebar-logo {
  height: 32px;
  width: auto;
  margin-right: 0.75rem;
}

#main-sidebar .brand-name {
  font-weight: 600;
  font-size: 1.1rem;
}

#main-sidebar .item.active {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

#main-sidebar .item:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

#main-sidebar .user-section {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.9rem;
}

#main-sidebar .ui.divider.inverted {
  border-top-color: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}

/* Inquiry notification badge */
#nav-inquiries {
  position: relative;
}

#nav-inquiries #inquiry-count {
  margin-left: 0.5rem;
}

/* Mobile Top Bar - hidden on desktop */
.mobile-topbar {
  display: none !important;
}

.mobile-topbar .logo {
  height: 24px;
  width: auto;
}

/* Desktop: Sidebar always visible, content pushed */
@media (min-width: 769px) {
  body.has-sidebar {
    padding-left: var(--omc-sidebar-width);
  }
  
  #main-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    transform: none !important;
    visibility: visible !important;
  }
  
  .pusher {
    transform: none !important;
    min-height: 100vh;
  }
}

/* Mobile: Sidebar hidden, toggle via hamburger */
@media (max-width: 768px) {
  .mobile-topbar {
    display: flex !important;
  }
  
  body.has-sidebar {
    padding-top: var(--omc-nav-height);
  }
  
  #main-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    transform: translate3d(-100%, 0, 0);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }
  
  #main-sidebar.visible {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
  }
}

/* =====================
   FOOTER
   ===================== */
#main-footer {
  background-color: var(--omc-bg-dark) !important;
  padding: 1rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--omc-footer-height);
}

/* Footer offset for sidebar on desktop */
@media (min-width: 769px) {
  body.has-sidebar #main-footer {
    left: var(--omc-sidebar-width);
  }
}

#main-footer .copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Add padding to main content to prevent footer overlap */
#main-content {
  padding-bottom: calc(var(--omc-footer-height) + 2rem) !important;
}

/* =====================
   LOGIN PAGE
   ===================== */
.login-page {
  background: linear-gradient(180deg, #e1f2ff 0%, #fff 77.69%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 2.5rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  height: 48px;
  width: auto;
}

.login-logo h2 {
  margin-top: 1rem;
  color: var(--omc-text);
  font-weight: 600;
}

.login-tabs {
  margin-bottom: 1.5rem;
}

.login-tabs .ui.menu {
  border-radius: 4px;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--omc-border-light);
}

.login-footer a {
  color: var(--omc-text-muted);
  font-size: 0.9rem;
}

.login-footer a:hover {
  color: var(--omc-primary);
}

/* =====================
   CARDS & PANELS
   ===================== */
.omc-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.omc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--omc-border-light);
}

.omc-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--omc-text);
}

.omc-card-content {
  color: var(--omc-text);
}

/* =====================
   JOB LIST
   ===================== */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  cursor: pointer;
}

.job-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.job-item-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--omc-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.job-item-icon i {
  font-size: 1.5rem;
  color: var(--omc-primary);
}

.job-item-content {
  flex: 1;
  min-width: 0;
}

.job-item-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--omc-text);
  margin-bottom: 0.25rem;
}

.job-item-meta {
  font-size: 0.85rem;
  color: var(--omc-text-muted);
}

.job-item-status {
  flex-shrink: 0;
  margin-left: 1rem;
}

.job-item-progress {
  flex-shrink: 0;
  margin-left: 1rem;
  width: 80px;
}

/* =====================
   WORKFLOW STEPS
   ===================== */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  padding: 1rem 0;
  position: relative;
}

.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 45px;
  bottom: -15px;
  width: 2px;
  background: var(--omc-border);
}

.workflow-step.completed::after {
  background: var(--omc-success);
}

.workflow-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
  z-index: 1;
}

.workflow-step.pending .workflow-step-icon {
  background: var(--omc-border);
  color: var(--omc-text-muted);
}

.workflow-step.in_progress .workflow-step-icon {
  background: var(--omc-primary);
  color: white;
}

.workflow-step.completed .workflow-step-icon {
  background: var(--omc-success);
  color: white;
}

.workflow-step-content {
  flex: 1;
}

.workflow-step-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.workflow-step-description {
  font-size: 0.9rem;
  color: var(--omc-text-muted);
}

.workflow-step-progress {
  margin-top: 0.5rem;
}

/* =====================
   INQUIRY LIST
   ===================== */
.inquiry-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  border-left: 4px solid var(--omc-warning);
}

.inquiry-item.awaiting_customer {
  border-left-color: var(--omc-warning);
}

.inquiry-item.resolved {
  border-left-color: var(--omc-success);
}

.inquiry-item-content {
  flex: 1;
}

.inquiry-item-subject {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.inquiry-item-preview {
  font-size: 0.9rem;
  color: var(--omc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-item-meta {
  flex-shrink: 0;
  margin-left: 1rem;
  text-align: right;
  font-size: 0.85rem;
  color: var(--omc-text-muted);
}

/* =====================
   PARCEL TRACKING
   ===================== */
.parcel-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.parcel-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.parcel-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--omc-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

.parcel-icon.incoming {
  background: #e3f2fd;
  color: #1976d2;
}

.parcel-icon.outgoing {
  background: #e8f5e9;
  color: #388e3c;
}

.parcel-info {
  flex: 1;
}

.parcel-tracking {
  font-weight: 600;
  font-size: 1rem;
}

.parcel-carrier {
  font-size: 0.85rem;
  color: var(--omc-text-muted);
}

.parcel-status {
  flex-shrink: 0;
}

.tracking-timeline {
  border-left: 2px solid var(--omc-border);
  margin-left: 1rem;
  padding-left: 1.5rem;
}

.tracking-event {
  position: relative;
  padding-bottom: 1rem;
}

.tracking-event::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--omc-border);
}

.tracking-event:first-child::before {
  background: var(--omc-primary);
}

.tracking-event-date {
  font-size: 0.8rem;
  color: var(--omc-text-muted);
}

.tracking-event-description {
  font-weight: 500;
}

.tracking-event-location {
  font-size: 0.85rem;
  color: var(--omc-text-light);
}

/* =====================
   INVOICES
   ===================== */
.invoice-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.invoice-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--omc-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.invoice-content {
  flex: 1;
}

.invoice-number {
  font-weight: 600;
}

.invoice-meta {
  font-size: 0.85rem;
  color: var(--omc-text-muted);
}

.invoice-amount {
  font-weight: 600;
  font-size: 1.1rem;
  margin-left: 1rem;
}

.invoice-actions {
  margin-left: 1rem;
}

/* =====================
   MESSAGES
   ===================== */
#message-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
}

#message-container .ui.message {
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#message-container .ui.message.floating {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* =====================
   UTILITIES
   ===================== */
.text-muted {
  color: var(--omc-text-muted) !important;
}

.text-light {
  color: var(--omc-text-light) !important;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 0.5rem !important;
}
.mb-2 {
  margin-bottom: 1rem !important;
}
.mb-3 {
  margin-bottom: 1.5rem !important;
}
.mb-4 {
  margin-bottom: 2rem !important;
}

.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 0.5rem !important;
}
.mt-2 {
  margin-top: 1rem !important;
}
.mt-3 {
  margin-top: 1.5rem !important;
}
.mt-4 {
  margin-top: 2rem !important;
}

.p-0 {
  padding: 0 !important;
}
.p-1 {
  padding: 0.5rem !important;
}
.p-2 {
  padding: 1rem !important;
}
.p-3 {
  padding: 1.5rem !important;
}
.p-4 {
  padding: 2rem !important;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .login-card {
    padding: 1.5rem;
  }

  .job-item {
    flex-wrap: wrap;
  }

  .job-item-progress {
    width: 100%;
    margin-left: 0;
    margin-top: 1rem;
  }

  #message-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  #main-nav .brand-name {
    display: none;
  }
}

/* =====================
   EMPTY STATES
   ===================== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--omc-text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--omc-text-light);
}

.empty-state-description {
  font-size: 0.95rem;
}

/* =====================
   LOADING STATES
   ===================== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 1.5em;
  width: 50%;
  margin-bottom: 1em;
}
