/* --- Global Variables & Theme --- */
:root {
  --bg-body: #f4f6f8;
  --bg-panel: #ffffff;
  --bg-input: #f9fafb;
  --text-main: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-color: #3b82f6;

  --border-color: #e5e7eb;
  --border-focus: #2563eb;

  --radius-sm: 6px;
  --radius-md: 12px; /* Smoother corners */
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-premium:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --font-family: "Poppins", "Inter", system-ui, -apple-system, sans-serif;
  --transition: all 0.2s ease-in-out;
}

/* --- Base Styles --- */
body {
  font-family: var(--font-family) !important;
  background-color: var(--bg-body) !important;
  background-image: none !important; /* Override protractor.css */
  color: var(--text-main);
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  line-height: 1.3;
  margin-top: 0;
  text-align: center; /* Center all titles globally */
}

/* --- Layout Containers --- */
.hfeed.site {
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}

/* Main Content Area */
#content {
  padding: 40px 20px;
}

/* Page Width Restrainer */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Premium Card Container for the App */
.detailed-protractor-app {
  background-color: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 30px;
  margin: 0 auto 60px; /* Centered with bottom margin */
  max-width: 1200px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header Tweaks */
.seven h1 {
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    #2563eb 0%,
    #d946ef 100%
  ); /* Colorful gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: none !important;
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}

/* Subtitle */
.post-2 > p {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

/* --- Canvas Container --- */
#canvasContainers {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); /* Subtle border */
  background: #fff;
  margin-bottom: 30px;
}

/* --- Controls Section (Dashboard) --- */
.controls {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0; /* Let children handle padding */
  overflow: hidden;
}

.controls-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 50% - 50% side by side */
  gap: 20px;
  padding: 24px;
}

/* Individual control panel */
.control-panel {
  min-width: 0; /* Prevent overflow */
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center; /* Center content */
  gap: 8px;
}

.panel-header i {
  color: var(--primary-color);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}

@media (max-width: 768px) {
  .controls-wrapper {
    grid-template-columns: 1fr; /* Stack on mobile */
  }
}

@media (max-width: 600px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}

.full-width {
  grid-column: 1 / -1;
}

/* Control Group Label */
.control-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Input Group Redesign */
.input-group {
  display: flex;
  align-items: stretch;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-sm);
}

.input-group button {
  background-color: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.input-group button:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.input-group button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
}

.input-group button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: none;
}

.input-group input[type="number"],
.input-group select,
.input-group input[type="file"] {
  flex: 1;
  border: 1px solid var(--border-color);
  text-align: center;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-main);
  background: #fff;
  height: 40px; /* Match button height */
  padding: 0 10px;
}

.input-group input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  z-index: 1;
}

/* Select Dropdown */
select#colorPicker {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0 12px;
  cursor: pointer;
}

.styled-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background-color: #fff;
}

/* File Input Wrapper */
.file-input {
  width: 100%;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* --- Action Buttons (Premium Design) --- */
.actions-panel {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 0;
}

.dropdown {
  flex: 1;
  width: 100%;
}

/* Base Button Styling */
.btn-action {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.btn-action i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn-action:hover i {
  transform: scale(1.15);
}

/* Primary Button - Download (Gradient Blue) */
.primary-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  border-color: transparent;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Secondary Button - Share (Gradient Purple/Pink) */
.secondary-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.secondary-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.secondary-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

/* Button Text */
.btn-action:hover {
  text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .actions-panel {
    flex-direction: column;
    gap: 10px;
  }

  .btn-action {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

/* Pushpin Styles */
.pushpin-controls {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0 !important;
}

.detailed-protractor-app .pushpin-controls {
  display: block !important;
}

#pushpinInputs {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.pushpin-control {
  background: white;
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-md);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.pushpin-control:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.pushpin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.pushpin-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pushpin-remove {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: none;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pushpin-remove:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

.pushpin-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mini Input Groups for X/Y */
.input-group.mini-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 36px;
}

/* Options/Dropdowns */
.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 8px 0;
  margin-top: 8px;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-item {
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  transition: background 0.1s;
}

.dropdown-item:hover {
  background-color: var(--bg-input);
  color: var(--primary-color);
}

/* --- Content Content Styling (Fixed) --- */

/* Content Wrapper */
.content-wrapper {
  /* Styles for the container of How To, FAQ, etc */
}

/* Headings */
.wp-block-heading.seven {
  font-size: 2rem !important;
  font-weight: 700;
  margin: 60px 0 30px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  position: relative;
  padding-bottom: 0;
}

.wp-block-heading.seven::after {
  display: none;
}

/* Lists */
.wp-block-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 0;
  margin-bottom: 50px;
  list-style: none; /* remove default bullets */
}

.wp-block-list li {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: block; /* box */
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  position: relative;
}

.wp-block-list li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.wp-block-list li::before {
  /* Using font awesome or unicode check */
  content: " \f00c"; /* FontAwesome check */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--primary-color);
  margin-right: 10px;
}

/* Images Row */
.images-row {
  display: flex;
  gap: 20px;
  margin: 40px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.img-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  max-width: 48%;
}

.img-card img {
  width: 100%;
  height: auto;
  display: block;
}

.img-card:hover {
  transform: scale(1.02);
}

/* Applications Grid */
.applications-section {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 50px 40px;
  margin: 60px 0;
  border-top: 4px solid var(--primary-color);
}

.apps-title.seven {
  margin-top: 0;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.app-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
  text-align: center;
}

.app-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.app-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.app-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.app-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Guidelines */
.guidelines-section {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-top: 60px;
}

.guidelines-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.guidelines-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.guideline-block {
  background: white;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.guideline-block h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-align: left;
}

.guideline-block h3::before {
  content: "";
  display: block;
  width: 4px;
  height: 1.1rem;
  background: var(--accent-color);
  border-radius: 2px;
}

.best-practices-box {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 30px;
  border-radius: var(--radius-md);
  grid-column: 1 / -1; /* spans full width */
}

.bp-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.best-practices-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.best-practices-box li {
  padding-left: 20px;
  position: relative;
  font-size: 0.95rem;
  opacity: 0.9;
}

.best-practices-box li::before {
  content: "•";
  color: #38bdf8;
  position: absolute;
  left: 0;
  font-weight: bold;
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 0 20px;
  }
  .wp-block-list,
  .apps-grid,
  .guidelines-container {
    grid-template-columns: 1fr;
  }
}
