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

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

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  display: flex;
  height: 100vh;
  background: white;
  overflow: hidden;
}

body.loaded {
  visibility: visible; /* Make it visible only when the 'loaded' class is present */
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sidebar Styles */
.sidebar {
  width: 63px;
  background: #000000; /* black background */
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
  padding-bottom: 5px;
  flex-shrink: 0;
}

.tool-button,
.zoom-btn-vertical {
  margin: 2px 0;
  background: transparent; /* Makes the button background invisible */
  border: none; /* Removes the border */
  color: white;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  font-size: 16px;
  font-weight: bold;
}

.tool-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.tool-button:hover:not(.disabled), 
.zoom-btn-vertical:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.15); /* Adds a subtle glow on hover */
}

.tool-button.active::before,
.zoom-btn-vertical.active::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background-color: white;
  border-radius: 2px;
}

.tool-button.active::before {
  left: 0;
}

.zoom-btn-vertical.active::before {
  right: 0;
}

/* Main Area Styles */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  overflow: hidden;
  
}

.canvas-container {
  flex: 1;
  background: white;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

/* Canvas Styles */
canvas {
  background: white;
  display: block;
  }

canvas:active {
  cursor: grabbing;
}

/*
 ======================================================
 --- DEFINITIVE AND CORRECTED INFO PANEL STYLES ---
 ======================================================
*/

.area-info {
  background: #212529; /* Professional dark charcoal background */
  border-top: 1px solid #444; /* Subtle top border for separation */
  color: #6c757d; /* Softer base color for labels */
  height: 28px; /* Slightly more height */
  padding: 0 20px;
  font-size: 12px; /* Slightly larger base font size */
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  
}

.area-info.panel-inactive .status-left span {
    color: #6c757d !important; /* Muted grey for inactive state */
    font-weight: normal !important;
}

.status-disabled {
  color: #6c757d; /* Muted grey for disabled text */
  font-weight: normal;
}

.status-separator {
  margin: 0 12px; /* Increased margin for more breathing room */
  color: #444; /* Muted separator color */
}

.status-active {
  font-weight: 600; /* Bolder for active text */
  color: #6c757d; /* Brighter color for active values */
}

.status-calibrated {
  color: #28a745 !important; /* Vibrant green for positive status */
  font-weight: bold;
}

.status-uncalibrated {
  font-weight: normal;
  color: #fffefd; 
}

#northStatusTrigger.highlighted {
  background-color: rgba(40, 167, 69, 0.2); /* Subtle green background */
  color: #28a745 !important; /* Matching green text color */
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.status-version {
  color: #6c757d;
  font-weight: normal;
}


/* --- End of Info Panel Styles --- */

.zoom-controls-vertical {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* This makes the container fill the available height */
  width: 100%;  /* Ensures buttons can be centered */
  }

.tool-button.disabled,
.zoom-btn-vertical.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none; /* This line prevents hover actions and hides the tooltip */
}

.tool-button.active,
#cropBtn.active,
#annotateBtn.active,
#measureBtn.active { 
  background: transparent;
}

.crop-selection {
  position: absolute;
  border: 2px dashed #4CAF50;
  background: rgba(76, 175, 80, 0.1);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

.crop-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border: 1px solid white;
  cursor: pointer;
}

.crop-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.crop-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.crop-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.crop-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.crop-handle.n { top: -4px; left: 50%; margin-left: -4px; cursor: n-resize; }
.crop-handle.s { bottom: -4px; left: 50%; margin-left: -4px; cursor: s-resize; }
.crop-handle.w { top: 50%; left: -4px; margin-top: -4px; cursor: w-resize; }
.crop-handle.e { top: 50%; right: -4px; margin-top: -4px; cursor: e-resize; }

/* --- STYLES FOR EXPORT DIALOG --- */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-dialog {
  background: #ffffff;
  padding: 20px; /* Reduced padding */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 320px; /* Reduced max-width for a smaller popup */
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Reduced gap between sections */
}

.modal-dialog h3 {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
  font-size: 18px;
}

.modal-dialog .form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-dialog label {
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.modal-dialog input[type="text"],
.modal-dialog input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

.modal-dialog .readonly-info {
  font-size: 13px;
  background: #f4f4f4;
  padding: 8px 10px;
  border-radius: 4px;
}

.modal-dialog fieldset {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-dialog legend {
  padding: 0 5px;
  font-weight: 600;
  font-size: 14px;
  color: #555;
}

.modal-dialog fieldset label {
  font-weight: normal;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.dialog-actions button {
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dialog-actions button.primary {
  background-color: #8f110d;
  color: white;
}
.dialog-actions button.primary:hover {
  background-color: #000000;
}

.dialog-actions button.secondary {
  background-color: #e0e0e0;
  color: #333;
}
.dialog-actions button.secondary:hover {
  background-color: #84120f;
  color: white;

}

/*
 =================================
 --- HELP DIALOG STYLES ---
 =================================
*/

.help-dialog {
    position: fixed;
    top: 100px;
    left: 100px;
    z-index: 2010;
    width: 600px; 
    min-width: 450px;
    max-width: 80vw;
    height: 90vh; 
    min-height: 400px;
    max-height: 700px;
    background: #ffffff;
    border: 1px solid #e0e0e0; /* More subtle border */
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15); /* Softer shadow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-dialog.hidden {
  display: none;
}

.help-dialog-header {
    background: #ffffff; /* Removed grey background */
    padding: 12px 20px; 
    cursor: move;
    border-bottom: 1px solid #e0e0e0; /* More subtle border */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-dialog-title {
  font-weight: 600; /* Bolder */
  font-size: 16px;  /* Larger */
}

.help-dialog-close {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
}
.help-dialog-close:hover {
  color: #000;
}

.help-dialog-content {
  padding: 20px 25px; /* Increased padding */
  overflow-y: auto;
  flex-grow: 1;
}

/* --- Start of New Formatting Logic --- */
.help-dialog-content h3 {
  font-size: 22px;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.help-dialog-content h4 {
    font-size: 16px; /* Slightly smaller */
    color: #111; /* Darker, more professional color */
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px; /* Tighter spacing */
}

.help-dialog-content h5 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.help-dialog-content p, .help-dialog-content li {
  font-size: 14px;
  line-height: 1.7; /* Increased line height for readability */
  color: #555;
}

.help-dialog-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 24px;
}

.help-dialog-content ul li {
  padding-left: 10px; /* Indent list items */
  margin-bottom: 16px; /* Space between list items */
}

.help-dialog-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 24px 0;
}

.help-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  font-size: 18px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
  vertical-align: middle;
}

.help-icon img {
  width: 18px;
  height: 18px;
}

.help-dialog-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  cursor: se-resize;
}

/* Styles for the step-by-step workflow list */
.help-quick-start-list {
  padding-left: 0;
  list-style: none;
}

.help-quick-start-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
}

.workflow-step-title {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  padding-right: 15px;
}

.workflow-step-title strong {
    font-size: 15px;
}

.workflow-step-description {
  flex: 1;
}
.area-info span.status-clickable {
  cursor: pointer;
}

.right-sidebar {
  width: 50px;
  background: rgb(0, 0, 0);
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 5px 25px 5px;
  flex-shrink: 0;
  position: relative;
}

/* --- START: STYLES FOR LOADING POPUP --- */

.loading-popup-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7); /* Use a light backdrop */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* Ensure it's on top of everything */
}

.loading-popup-content {
  background-color: #000000;
  color: #ffffff;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 16px;
}

/* Simple CSS-based loading spinner */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- END: STYLES FOR LOADING POPUP --- */

.sidebar-spacer {
  flex-grow: 1; /* This pushes the version display to the bottom */
}

.version-display {
  padding: 25px 0 5px 0;
  font-size: 13px;
  font-weight: 900;
  color: #cacaca; /* A muted grey color */
  text-align: center;
}

.hidden {
  display: none;
}

#welcomePopup p {
  margin-bottom: 5px !important;
}

/* Update this rule to reduce space between labels and inputs */
.modal-dialog .form-section {
  display: flex;
  flex-direction: column;
  gap: 4px; /* Reduced gap */
}

.modal-dialog input[type="text"],
.modal-dialog input[type="email"],
.modal-dialog input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* This ensures the focus style is also consistent */
.modal-dialog input[type="text"]:focus,
.modal-dialog input[type="email"]:focus,
.modal-dialog input[type="number"]:focus {
  border-color: #8f110d;
  box-shadow: 0 0 0 2px rgba(23, 131, 107, 0.2);
  outline: none;
}

.status-user-name {
  color: #e0e0e0;
  font-weight: 600;
  padding-left: 15px;
}

.sidebar-spacer {
  flex-grow: 1; /* This makes the spacer expand, pushing the button to the bottom */
}

#youtubeBtn {
  margin-top: auto; /* This pushes the button to the bottom */
}

.coming-soon-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 18px 30px;
  border-radius: 10px;
  z-index: 2000;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.coming-soon-popup.show {
  opacity: 1;
  visibility: visible;
}

.tool-button img,
.zoom-btn-vertical img {
  width: 24px;
  height: 24px;
}

/* --- Welcome Note Pop-up Styles --- */

/* The full-screen backdrop */
.setvastu-popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/* The dialog box itself */
.setvastu-popup-dialog {
  background: #ffffff;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The main title of the note */
.welcome-title {
  padding: 16px 20px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #8f110d; /* Theme Color */
  border-bottom: 1px solid #eee;
}

/* Container for the collapsible sections */
.accordion-container {
  overflow-y: auto;
  padding: 0 20px;
}

.accordion-item {
  border-bottom: 1px solid #f0f0f0;
}
.accordion-item:last-child {
  border-bottom: none;
}

/* Styling for the clickable headers */
.accordion-header {
  width: 100%;
  background: none;
  border: none;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: #8f110d; /* Theme Color */
}

.accordion-icon {
  font-size: 20px;
  font-weight: bold;
  transition: transform 0.3s ease;
}

/* Rotate icon when active */
.accordion-header.active .accordion-icon {
  transform: rotate(45deg);
}

/* The content that gets shown/hidden */
.accordion-content {
  max-height: 0; /* Hidden by default */
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  color: #000000; /* Theme Color */
  font-size: 14px; /* Small Font Size */
  font-weight: 400; /* Regular Weight */
}

.accordion-content p, 
.accordion-content ul {
  padding: 0 0 14px 0;
  line-height: 1.6;
}

.accordion-content ul {
  padding-left: 20px;
}

/* Area for the 'Join Us' button */
.popup-actions {
  padding: 16px 20px;
  margin-top: auto;
  border-top: 1px solid #eee;
  text-align: right;
}

.join-us-button {
  background-color: #8f110d; /* Theme Color */
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.join-us-button:hover {
  background-color: #700d0a;
}

.tool-button.active img {
  filter: brightness(0) invert(1);
}

.tool-button img,
.zoom-btn-vertical img {
  filter: brightness(0) invert(1);
}

.sidebar-bottom-group {
  margin-top: auto; /* This pushes the group to the bottom */
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* --- START: UPDATED CUSTOM TOOLTIP STYLES --- */

.tool-button[data-tooltip]::after,
.zoom-btn-vertical[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #212529;
  color: #e9ecef;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

/* 2. This rule positions the tooltip for the LEFT sidebar (to the right) */
.tool-button[data-tooltip]::after {
  left: 100%;
  margin-left: 12px;
}

/* 3. This rule positions the tooltip for the RIGHT sidebar (to the left) */
.zoom-btn-vertical[data-tooltip]::after {
  right: 100%;
  margin-right: 12px;
}

/* This rule makes the tooltip appear on hover (works for both) */
.tool-button[data-tooltip]:hover::after,
.zoom-btn-vertical[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- START: PAYMENT DIALOG STYLES --- */

.payment-dialog {
  max-width: 640px; /* Wider dialog for plan layout */
  text-align: center;
}

.payment-plans {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%;
  margin-top: 24px; /* Add space below the title */
}

.plan-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease-in-out;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: #8f110d;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.plan-card h4 {
  font-size: 18px;
  color: #343a40;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 32px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 12px;
}

/* New styles for the feature list */
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.plan-features li {
  font-size: 14px;
  color: #495057;
  margin-bottom: 10px;
}

.plan-features li.excluded {
  color: #adb5bd; /* Grey out excluded features */
  text-decoration: line-through;
}

/* --- END: PAYMENT DIALOG STYLES --- */

/* --- START: WHATSAPP QR CODE DIALOG STYLES --- */

.qr-code-dialog {
  max-width: 320px; /* Made the dialog more compact */
  text-align: center;
  padding: 25px;    /* Slightly reduced padding */
  position: relative;
}

.qr-code-dialog h3 {
  margin-bottom: 15px; /* Reduced margin */
  font-size: 18px;     /* Slightly smaller font */
}

.qr-code-dialog p {
  margin-top: 15px; /* Reduced margin */
  color: #6c757d;
  font-size: 14px;  /* Slightly smaller font */
  line-height: 1.5;
}

.qr-code-image {
  /* --- Start of new logic --- */
  display: block;        /* Necessary for margin auto to work */
  margin: 0 auto;        /* This horizontally centers the image */
  /* --- End of new logic --- */
  width: 100%;
  max-width: 220px;      /* Reduced size for a more compact look */
  height: auto;
  border-radius: 8px;
  border: 1px solid #eee;
}

.qr-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: #adb5bd;
  cursor: pointer;
  line-height: 1;
}

.qr-close-btn:hover {
  color: #495057;
}

#whatsappBtn img {
  filter: none;
}

/* --- END: WHATSAPP QR CODE DIALOG STYLES --- */

.plan-card.recommended {
    border-color: #8f110d; /* Theme color for the border */
    transform: scale(1.05); /* Make it slightly larger */
    position: relative; /* Needed for the badge */
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #8f110d;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-user-name {
    position: relative; /* Required for tooltip positioning */
}

.status-user-name[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%; /* Position tooltip above the text */
  right: 100%;
  transform: translateY(-50%);
  margin-right: 8px;
  background: #212529;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: normal;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

.status-user-name[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- Minimalist Scrollbar for Webkit Browsers (Chrome, Safari) --- */
.help-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.help-dialog-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.help-dialog-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.help-dialog-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Vaishali Name */
#canvasContainer {
    position: relative; /* Make sure this exists */
}

#canvasContainer::after {
    content: "[Vaishali Architects]";
    white-space: pre;
    position: absolute;
    bottom: 3px;
    left: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #3a3a3a;
    pointer-events: visibleFill;
    z-index: 100;
}
/* Vaishali Name */

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
