/* Copyright 2023 Wayne Fincher

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), 
to deal in the Software without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the 
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included 
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT-
ABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

:root {
	--color-primary: #eee;
	--color-grey-medium: #333;
    --color-secondary-grey: #a4a4a4; /* Has sufficient contrast with --bg-color-secondary */

	--bg-color-primary: #070707;
	--bg-color-secondary: #141414;
    --bg-color-highlight: #18194b;
	--bg-color-grey-medium: #333;
    --bg-color-active: hsl(47.6, 19.2%, 29.6%);
	--border-color-primary: #303291; /*303291 2f3067*/

	--color-focus-border: hsl(86, 74%, 15%);
	--color-focus-box-shadow: hsl(86, 74%, 44%);
	--color-hover-border: hsl(43, 74%, 15%);
	--color-hover-box-shadow: hsl(43, 74%, 44%);
	--color-active: white;

    --color-fret-border: #5c5a5a;
    --color-offset-fret-color: #1f1f1f;

    --gap: 20px;
}

body {
	color: var(--color-primary);
	background-color: var(--bg-color-primary);
	/* font-family: 'Trebuchet MS'; */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

header {
    background-color: var(--bg-color-secondary);
    color: var(--color-primary);
    padding: 0.6rem;
    text-align: center;

    & h1 {
        margin: 0;
    }
}

footer {
	font-size: 0.6rem;
}

[hidden] {
    display: none !important;
}


/* 1. Top Section */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color-primary);
}

.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.global-actions {
  display: flex;
  gap: 10px;
}


/* 2. Toolbar Section */
.control-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color-primary);
}

.primary-tools,
.canvas-tools,
.zoom-controls,
.view-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}



/* 3. Main Canvas Section */
.canvas-container {
  padding: 12px; /* Slightly reduced padding on mobile */
  min-height: calc(100vh - 120px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Optional: Mobile-specific adjustments */
@media (max-width: 768px) {
  .app-header {
    padding: 8px 12px;
    flex-direction: column;
    gap: 8px;
  }

  .control-toolbar {
    padding: 8px 12px;
    flex-direction: row;
    gap: 8px;
  }

  .control-toolbar > .primary-tools,
  .control-toolbar > .canvas-tools {
    flex-direction: column;
  }

  .control-toolbar > .primary-tools {
    flex-direction: column-reverse;
  }
}

.diagram-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: start;
}

@media print {
  .control-toolbar,
  #save-btn {
    display: none;
  }

  body {
    background-color: transparent;
    color: #111;
  }

  header {
    background-color: transparent;
    color: #111;
  }
}