/* GAYA KUSTOM ZIPZAP (BOOTSTRAP OVERRIDE) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #0056FF;
  /* Brand Red Accent -> Lebih hidup */
  --primary-hover: #578efd;
  --primary-soft: rgba(36, 63, 214, 0.1);
  --accent: #0056FF;
  --bg-soft: #f8fafc;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--bg-soft);
  color: var(--text-dark);
}

/* NAVBAR (Creative Red Accent Theme) */
.navbar {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  padding: 0.8rem 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
}

/* Garis aksen gradient di bawah navbar */
.navbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}

/* Logo - Clean */
.navbar-brand img {
  height: 42px;
}

/* Nav Link dengan Efek Modern */
.nav-link {
  font-weight: 600;
  color: #475569 !important;
  padding: 0.6rem 1.25rem !important;
  margin: 0 0.25rem;
  border-radius: 50px;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Efek Hover Background Blob */
.nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover {
  color: var(--primary) !important;
  transform: translateY(-2px);
}

.nav-link:hover::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Active State */
.nav-link.active {
  color: white !important;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  /* Shadow dihapus agar tidak blur */
  box-shadow: none;
  transform: translateY(-1px);
}

.nav-link.active:hover {
  transform: translateY(-2px);
}

/* Dropdown dengan Animasi Bouncy */
.dropdown-menu {
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.02);
  border-radius: 20px;
  padding: 0.75rem;
  margin-top: 1rem;
  animation: dropdownBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: top center;
}

@keyframes dropdownBounce {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item {
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-bottom: 2px;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f1f2ff;
  /* Red-50 */
  color: var(--primary);
  padding-left: 1.5rem;
  /* Efek geser teks */
}

.dropdown-item:active {
  background-color: var(--primary-soft);
}

/* CARD */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  margin-bottom: 20px;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 16px 16px 0 0 !important;
  padding: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
}

/* TABLE */
.table {
  vertical-align: middle;
}

.table thead th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
}

/* BUTTONS UPDATE */
.btn {
  border-radius: 50px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  border: none;
  box-shadow: 0 4px 12px rgba(29, 65, 225, 0.4);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  box-shadow: 0 8px 20px rgba(29, 65, 225, 0.4);
  transform: translateY(-2px);
}

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

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: rgb(255, 255, 255);
}

.btn-success {
  background-color: #10b981;
  border-color: #10b981;
}

.btn-danger {
  background-color: #0056FF;
  border-color: #0056FF;
}

/* UTILITIES */
.page-title {
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0;
}

.result-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
}

.price-box {
  font-size: 1.25rem;
  font-weight: 700;
}

.x-small {
  font-size: 0.75rem !important;
}
/* Helper Classes */
.border-dashed {
  border-style: dashed !important;
}

.bg-soft-primary {
  background-color: #f0f9ff;
}

/* Blue Theme Overrides */
.bg-blue {
  background-color: #0d6efd !important;
}

.bg-soft-blue {
  background-color: #e7f1ff !important;
}

.text-blue {
  color: #0d6efd !important;
}

.border-blue {
  border-color: #0d6efd !important;
}

/* Additional Utilities */
.table-scrollable-container {
  max-height: 300px;
  overflow-y: auto;
}

.table-text-90 {
  font-size: 0.9rem !important;
}

.w-100px {
  width: 100px !important;
}

/* --- MOCKUP STUDIO STYLES --- */

/* Basic Layout & Workspace */
body.mockup-page {
    background-color: #f8fafc;
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.workspace-area {
    background-color: #e2e8f0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #cbd5e1;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Dual View Container (Front/Back) */
#dual-view-container {
    display: flex;
    gap: 40px;
    padding: 50px;
    transform-origin: center center;
    transition: transform 0.1s linear;
}

/* Mockup Canvas Card */
.mockup-item {
    position: relative;
    width: 400px;
    height: 500px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Soft shadow */
    user-select: none;
    overflow: hidden; /* Masking kotak */
}

/* Layer System */
.mockup-layer-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 1;
}

.mockup-layer-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    mix-blend-mode: multiply;
    opacity: 0.85;
    pointer-events: none;
}

.mockup-base-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    overflow: hidden;
}

/* Draggable Logo Elements */
.logo-item {
    position: absolute;
    cursor: move;
    border: 1px dashed transparent;
    width: 100px;
}

.logo-item img {
    width: 100%;
    display: block;
    pointer-events: none;
}

.logo-item:hover,
.logo-item.active-edit {
    border: 1px dashed #0d6efd;
}

.resize-handle {
    width: 12px;
    height: 12px;
    background-color: #0d6efd;
    position: absolute;
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
    border-radius: 50%;
    opacity: 0;
    z-index: 20;
}

.logo-item:hover .resize-handle,
.logo-item.active-edit .resize-handle {
    opacity: 1;
}

.design-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    font-weight: 700;
    color: #333;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

/* Color Palette Swatches */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #eee;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #333;
    transform: scale(1.15);
}

/* Sidebar Steps */
.step-card {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.step-number {
    display: inline-flex;
    width: 24px;
    height: 24px;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    #dual-view-container,
    #dual-view-container * {
        visibility: visible;
    }

    #dual-view-container {
        position: absolute;
        left: 50%;
        top: 0;
        transform: translateX(-50%) scale(0.65) !important;
        width: auto;
        height: auto;
        margin-top: 20px;
    }

    .no-print {
        display: none !important;
    }

    nav.navbar {
        display: none !important;
    }
}

/* --- SCALE RULER PAGE STYLES --- */
body.scale-ruler-page {
    height: 100vh; /* Replaced 100% with vh for explicit viewport height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-workspace {
    flex: 1;
    overflow: hidden;
}

.canvas-container {
    background-color: #e9ecef;
    border: 1px dashed #adb5bd;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container canvas {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar-scroll {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Sticky Offset Utility */
.sticky-offset-top {
    top: 100px;
    z-index: 10;
}
