:root {
	--color-accent: #007bff;
	--color-btn-dl: #28a745;
	--color-btn-active-border: #ddd;
}
@font-face {
	font-family: 'b';
	src: url('../fonts/GoogleSans-Bold.ttf');
	font-family: 'b';
	font-style: normal;
}
@font-face {
	font-family: 'mono';
	src: url('../fonts/DejaVuSansMono.ttf');
}
* {
	box-sizing: border-box;
}
/* Default styles for all screen sizes (mobile-first) */
body {
	font-family: -webkit-system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	margin: 0; /* Reset default margin */
    padding: 0px;
    height: 100%; /* Make the body fill the html element's height */
    /* Turn the body into a flexible container that arranges children vertically */
    display: flex;
    flex-direction: column;
    /* Use padding instead of margin to reserve space for the fixed footer. */
    /* This prevents the editor from being hidden behind it. */
    width: 100%;
    box-sizing: border-box;
}
.editor-area-container {
    display: flex;
    gap: 0px;
    align-items: stretch;
    height: 200vh;
	margin-bottom: 200px;
}
.preview-container, #htmlContent  {
	height: 100%; /* Keep the original height value */
	border: 1px solid #ddd;
	border-radius: 0 5px 5px 5px;
}
/* Styles for desktop screens (e.g., wider than 768px) */
@media screen and (min-width: 768px) {
	body {
        /* On larger screens, constrain the width and center it */
		max-width: 1200px;
		margin-left: auto;
		margin-right: auto;
        /* You might want to adjust padding for desktop */
        padding: 20px;
		margin-bottom: 200px; /* Keep space for your fixed footer */
	}
	.editor-area-container {
		height: 1000px;
	}
}
label {
	display: block;
	font-family: 'b';
	margin-bottom: 8px;
	color: #495057;
}
#htmlContent:focus {
	outline: none;
	border-color: #007bff;
	background-color: white;
}
/* --- UNIFIED BUTTON STYLES --- */
.button_shared {
	padding: 5px;
	font-size: 1rem;
	font-family: 'b';
	border-radius: 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.button_base {
	border: 1px solid transparent;
	cursor: pointer;
}
/* State: Disabled */
.button_base:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	background-color: #eee;
	color: #888;
	border: 1px solid #ddd;
}
.button_action_primary {
	background-color: var(--color-accent);
}
.button_action_secondary {
	background-color: var(--color-btn-dl);
}
.button_action_secondary, .button_action_primary  {
	border: 1px solid #ddd;
	font-family: 'b';
	color: #fff;
	width: fit-content;
}
.view-toggle, .format-toggle {
	display: inline-flex;
	overflow: hidden;
	border-radius: 5px;
	 min-height: 42px; /* Matches the height of other buttons */
}
.view-toggle .button_shared, .format-toggle .button_shared {
	border-radius: 0;
	border: 1px solid #ddd;
	background-color: #f8f8f8;
	color: #888;
}
.view-toggle .button_shared:hover, .format-toggle .button_shared:hover {
	background-color: #e9ecef;
}
.view-toggle .button_shared:first-of-type, .format-toggle .button_shared:first-of-type {
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
}
.view-toggle .button_shared:last-of-type, .format-toggle .button_shared:last-of-type {
	border-top-right-radius: 6px;
	border-bottom-right-radius: 6px;
}
 .view-toggle .button_base, .format-toggle .button_base {
	border-right-width: 0;
}
.view-toggle .button_base:last-of-type, .format-toggle .button_base:last-of-type {
	border-right-width: 1px;
}
.view-toggle input[type="radio"],
.format-toggle input[type="radio"] {
	display: none;
}
.view-toggle input[type="radio"]:checked + label,
.format-toggle input[type="radio"]:checked + label {
	background-color: var(--color-accent);
	color: #fff;
	border-color: var(--color-btn-active-border);
}
.button-container {
	display: flex;
	gap: 10px;
}
.output-link {
	margin: 20px 0;
	padding: 15px;
	background-color: #e7f3ff;
	border-left: 4px solid #007bff;
	border-radius: 6px;
	display: none;
}
.output-link a {
	color: #007bff;
	text-decoration: none;
	font-family: 'b';
	font-size: 16px;
}
.output-link a:hover {
	text-decoration: underline;
}
.content-area {
	height: 350px;
}
.preview-container {
	overflow: hidden;
}
#htmlContent {
	width: 100%;
	font-family: 'mono', 'Consolas', 'Monaco', 'Courier New', monospace;
	font-size: 1rem;
	line-height: 1.5;
	padding: 10px;
	resize: none;
}
#preview {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}
.top-controls {
	-display: flex;
	-justify-content: space-between;
	align-items: top;
}
#dropdownTrigger {
  -position: fixed; /* Changed from 'absolute' to 'fixed' */
  -background-color: var(--color-accent);
  -border: 1px solid #ddd;
  -margin-right: 10px; /* Margin won't apply because it's fixed */
  -height: 50px;
  -width: 20px;
  -left: 0; /* Position from the left of the screen */
  -top: 100px; /* Corrected from '50' to '50px' */
  -border-top-right-radius: 10px; /* Adjust value as needed */
  -border-bottom-right-radius: 10px; /* Adjust value as needed */
  -border-top-left-radius: 0;
  -border-bottom-left-radius: 0;
  -cursor: pointer;
  -opacity: 0.7; /* Makes the whole element 70% opaque */
}
/* -- Custom Tooltip -- */
.custom-tooltip {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 15px 20px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 2000;
	display: flex;
	align-items: center;
	opacity: 0;
	transform: translateX(100%);
	visibility: hidden;
	transition: opacity 0.5s, transform 0.5s, visibility 0.5s;
}
.custom-tooltip.show {
	opacity: 1;
	transform: translateX(0);
	visibility: visible;
}
.custom-tooltip.success {
	background-color: #d4edda;
	color: #155724;
	border-left: 5px solid #28a745;
}
.custom-tooltip.error {
	background-color: #f8d7da;
	color: #721c24;
	border-left: 5px solid #dc3545;
}
/* Add this new rule for the 'in-progress' state */
.custom-tooltip.progress {
	background-color: #d1ecf1; /* Light blue */
	color: #0c5460;
	border-left: 5px solid #007bff; /* Main accent color */
}
.tooltip-close-btn {
	background-color: transparent;
	border: none;
	font-size: 20px;
	margin-left: 15px;
	cursor: pointer;
	padding: 0 5px;
	line-height: 1;
	color: var(--color-accent);
}
/* Sidebar container */
.sidebar {
	position: fixed;
	top: 0;
	left: -300px; /* Initially off-screen */
	height: 100%;
	width: 300px;
	background-color: #f9f9f9;
	box-shadow: 4px 0 10px rgba(0, 0, 0, 0.2);
	z-index: 2000;
	transition: left 0.3s ease-in-out; /* Smooth slide-in/out animation */
	display: flex;
	flex-direction: column;
	color: #333;
}
/* Sidebar visible state */
.sidebar.show {
	left: 0; /* Slide into view */
}
/* Sidebar header (close button placement) */
.sidebar-header {
	display: flex;
	justify-content: flex-end;
}
/* Sidebar close button */
.close-sidebar {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--color-accent);
	cursor: pointer;
}
.sidebar-item, .preset-item {
    padding: 10px;
    cursor: pointer;
    user-select: none; /* Prevent text selection */
    word-wrap: break-word; /* Handle long preset names */
    position: relative; /* Needed for pseudo-element positioning */
}
.sidebar-item::after, .preset-item::after {
    content: "";
    display: block;
    width: 30%; /* Border bottom width is 80% */
    height: 1px; /* Thickness of the border */
    background-color: #ddd; /* Border color */
    margin: 0 auto; /* Center the border */
    position: absolute;
    bottom: 0; /* Position it at the bottom of the element */
    left: 0%; /* Centers the border (100% - 80%) / 2 */
}
.sidebar-item:hover, .preset-item:hover {
    background-color: #e9ecef;
	-border-color: var(--color-accent);
}
/* Specific styles for the details/summary structure */
#presetsDetails summary {
    list-style: none; /* Remove default arrow */
    outline: none; /* Remove focus outline */
}
#presetsDetails summary::-webkit-details-marker {
    display: none; /* Remove default arrow in webkit browsers */
}
.presets-summary {
    position: relative;
    padding-left: 30px; /* Make room for custom arrow on the LEFT */
}
/* Custom arrow for the details - moved to LEFT */
.presets-summary::before {
    content: '▶';
    position: absolute;
    left: 5px; /* Position on the left */
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
	color: var(--color-accent);
}
/* Rotate arrow when details is open */
#presetsDetails[open] .presets-summary::before {
    transform: translateY(-50%) rotate(90deg);
}
/* Remove the old ::after pseudo-element */
.presets-summary::after {
    display: none;
}
/* Make sidebar content scrollable */
.sidebar-content {
    padding: 5px;
    flex: 1;
    overflow-y: auto; /* This was already there - making sure it's present */
    max-height: calc(100vh - 60px); /* Ensure it doesn't exceed viewport minus header */
	-color: red;
	overflow-y: auto;
}
/* Ensure preset items fit well in scrollable area */
#presets_container {
    margin-top: 10px;
    padding-bottom: 10px;
    /* Presets are always populated and visible when details is open */
}
.footer {
      position: fixed; /* Fixes to the screen (viewport) */
      bottom: 0; /* Sticks to the bottom of the viewport */
      left: 0; /* Sticks to the bottom of the viewport */
      width: 100%; /* Spans full width of the screen */
      color: #888;
      background-color: #f9f9f9; /* Light background for visibility */
      text-align: center;
      padding: 10px 0; /* Add vertical padding */
      border-top: 1px solid #ddd;
      z-index: 1000; /* Ensure it stays above other content */
}
.key_info {
	font-size: 1rem;
	padding: 10px;
	margin-bottom: 20px;
	border-radius: 5px;
	font-family: Arial, sans-serif;
	border: 1px solid #888;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}
/* Styles for each scenario */
.key-valid {
	background-color: #d4edda;
	color: #155724;
}
.key-invalid {
	background-color: #f8d7da;
	color: #721c24;
}
.key-expired {
	background-color: #f8d7da;
	color: #856404;
}
.key-not-provided {
	background-color: #f8d7da;
	color: #0c5460;
}
/* ==================== */
/* --- NEW LAYOUT STYLES --- */
.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.content-area {
    flex-grow: 1;
    height: 100%;
}
#htmlContent, .preview-container {
    height: 100%;
}
/* --- VERTICAL TOOLBAR STYLES --- */
.vertical-toolbar {
    position: sticky;
    top: 0px;
    align-self: flex-start;
    z-index: 10;
	
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
	border-right-width: 0;
    background-color: #f8f9fa;
    width: 60px;
    flex-shrink: 0; /* ADD THIS LINE to prevent shrinking */
}
.toolbar-button {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    color: #333;
    /* This ensures padding is respected inside the fixed dimensions */
    box-sizing: border-box;
}
.toolbar-button:hover {
    border-color: var(--color-accent);
    background-color: #e9ecef;
}
.toolbar-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #eee;
    border-color: #ddd;
}
.toolbar-toggle-group input[type="radio"] {
    display: none; /* Hide the actual radio button */
}
/* --- CLEANUP: Remove or hide old/unused styles --- */
.button-container,
.top-controls,
.format-toggle:not(.toolbar-toggle-group), /* Hides original format-toggle */
.view-toggle:not(.toolbar-toggle-group) { /* Hides original view-toggle */
    display: none;
}
/* --- CORRECTED TOOLBAR TOGGLE STYLES --- */
.toolbar-toggle-group {
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #ccc;
}
.toolbar-toggle-group input[type="radio"] {
    display: none; /* Hide the actual radio button */
}
.toolbar-toggle-label {
    background-color: #fff;
    color: #555;
    cursor: pointer;
    font-family: 'b';
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 0; /* ADD THIS LINE TO FIX THE SPACING */
}
/* Then, ONLY remove the border from the very last label in the group */
.toolbar-toggle-group label:last-of-type {
    border-bottom: none;
}
/* The active state remains the same */
.toolbar-toggle-group input[type="radio"]:checked + .toolbar-toggle-label {
    background-color: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* --- SVG Icon Normalization --- */
.toolbar-button svg,
.toolbar-toggle-label svg {
    /* Use a fixed pixel value for absolute consistency */
    width: 32px;
    height: 32px;
    
    /* This prevents the icon from shrinking if the container is crowded */
    flex-shrink: 0;
}