/* Amazing Keyster — Base Stylesheet */

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

body {
    font-family: Lato, 'Segoe UI', sans-serif;
    color: #111;
    background: #fff;
    line-height: 1.7;
}

.hero-banner {
    width: 100%;
    background: #000;
}

.hero-banner img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

img {
    max-width: 100%;
    height: auto;
}

header {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 60px 20px 40px;
}

header h1 {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 48px;
    font-weight: normal;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

header .tagline {
    font-size: 18px;
    color: #aaa;
    font-weight: 300;
}

main {
    margin: 0 auto;
    padding: 40px 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 28px;
    font-weight: normal;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #000;
}

p {
    font-size: 16px;
    margin-bottom: 12px;
}

ol {
    padding-left: 25px;
    margin-top: 10px;
}

li {
    font-size: 16px;
    margin-bottom: 10px;
}

.intro {
    text-align: center;
    padding: 40px 0;
}

.intro h2 {
    border: none;
    font-size: 32px;
}

.intro p {
    font-size: 18px;
    color: #444;
}

.cta {
    text-align: center;
    padding: 40px;
    background: #f5f5f5;
    border: 2px solid #000;
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
}

.generator {
    padding: 40px 20px;
    background: #f5f5f5;
    border: 2px solid #000;
    overflow: visible;
    min-height: 100vh;
    box-sizing: border-box;
}

.generator h2 {
    text-align: center;
}

.chat-log {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 20px;
    margin-bottom: 12px;
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 85%;
}

.chat-msg.bot {
    background: #e9e9e9;
    color: #222;
    margin-right: auto;
}

.chat-msg.user {
    background: #000;
    color: #fff;
    margin-left: auto;
    text-align: right;
}

.chat-msg em {
    font-size: 13px;
    color: #666;
}

.suggestion {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin: 3px 2px;
    font-size: 13px;
    transition: background 0.2s;
}

.suggestion:hover {
    background: #444;
}

.dice-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.dice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 18px;
    letter-spacing: 1px;
    padding: 10px 24px;
    min-width: 160px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.dice-btn:hover {
    background: #000;
    color: #fff;
}

.dice-label {
    font-size: 14px;
    letter-spacing: 2px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #000;
    background: #fff;
    border-radius: 4px;
}

#chat-input:focus {
    outline: none;
    border-color: #444;
}

#generate-btn {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 4px;
    white-space: nowrap;
}

#generate-btn:hover {
    background: #fff;
    color: #000;
}

/* ============================================================
   C BOARD SECTION
   ============================================================ */

.cboard-intro {
    text-align: center;
    padding: 40px 0 0;
    margin-top: 20px;
}

.cboard-intro h2 {
    border: none;
    font-size: 32px;
}

.cboard-intro p {
    font-size: 18px;
    color: #444;
}

.cboard-generator {
    margin-top: 10px;
}

#cb-input {
    flex: 1;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #000;
    background: #fff;
    border-radius: 4px;
}

#cb-input:focus {
    outline: none;
    border-color: #444;
}

.cb-generate-btn {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 4px;
    white-space: nowrap;
}

.cb-generate-btn:hover {
    background: #fff;
    color: #000;
}

/* ============================================================
   MICROPHONE BUTTON — Speech-to-Text
   ============================================================ */

.mic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    align-self: stretch;
    background: #fff;
    border: 2px solid #000;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    font-size: 22px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    padding: 0;
    line-height: 1;
}

.mic-btn:hover {
    background: #000;
    color: #fff;
}

.mic-btn.recording {
    background: #E53935;
    border-color: #E53935;
    color: #fff;
    animation: mic-pulse 1s ease-in-out infinite;
}

.mic-btn.mic-unsupported {
    opacity: 0.3;
    cursor: not-allowed;
}

@keyframes mic-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.cb-image-display {
    text-align: center;
    margin: 16px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cb-image-display img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.cb-download-row {
    margin-top: 12px;
}

.cb-download-btn {
    display: inline-block;
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 2px;
    padding: 8px 24px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
    cursor: pointer;
    vertical-align: middle;
}

.cb-download-btn:hover {
    background: #fff;
    color: #000;
}

/* ============================================================
   V2: KEYBOARD + NOTATION SECTION
   ============================================================ */

.v2-container {
    margin: 0 auto;
    padding: 0 40px 40px;
}

.v2-intro {
    text-align: center;
    padding: 40px 0 0;
    margin-top: 20px;
    margin-bottom: 40px;
}

.v2-intro h2 {
    border: none;
    font-size: 32px;
}

.v2-intro p {
    font-size: 18px;
    color: #444;
}

.v2-generator {
    margin-top: 10px;
}

.v2-display {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 16px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: visible;
}

.v2-diagram-panel {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.v2-diagram-panel img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.v2-notation-panel {
    width: 400px;
    min-width: 340px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 360px;
    padding: 8px;
    overflow: visible;
}

.v2-notation-panel svg {
    max-width: 100%;
    height: auto;
}

.v2-octave-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.v2-octave-label {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    margin-right: 8px;
}

.v2-oct-btn {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 6px 16px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.v2-oct-btn:hover {
    background: #000;
    color: #fff;
}

.v2-oct-btn.active {
    background: #000;
    color: #fff;
}

.v2-download-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

#v2-input {
    flex: 1;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #000;
    background: #fff;
    border-radius: 4px;
}

#v2-input:focus {
    outline: none;
    border-color: #444;
}

/* ============================================================
   FRETBOARD SECTION
   ============================================================ */

.fb-display {
    text-align: center;
    margin: 16px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow-x: auto;
}

.fb-display img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 2px;
}

#fb-input {
    flex: 1;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #000;
    background: #fff;
    border-radius: 4px;
}

#fb-input:focus {
    outline: none;
    border-color: #444;
}

/* ============================================================
   KNOWLEDGE BASE TEACHER
   ============================================================ */

.kb-answer-display {
    background: #fafafa;
    border: 2px solid #000;
    border-radius: 4px;
    padding: 24px;
    margin: 12px 0;
}

.kb-heading {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000;
}

.kb-body {
    font-size: 16px;
    line-height: 1.8;
}

.kb-body div {
    margin-bottom: 4px;
}

.kb-body br {
    margin-bottom: 8px;
}

.kb-table {
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 15px;
    width: auto;
}

.kb-table th, .kb-table td {
    border: 1px solid #999;
    padding: 6px 14px;
    text-align: left;
}

.kb-table th {
    background: #000;
    color: #fff;
    font-weight: bold;
}

.kb-table tr:nth-child(even) td {
    background: #f0f0f0;
}

.kb-list-item {
    padding-left: 20px;
    margin-bottom: 4px;
}

.kb-num {
    font-weight: bold;
}

.kb-bullet {
    padding-left: 24px;
    position: relative;
}

.kb-bullet::before {
    content: "\2022";
    position: absolute;
    left: 10px;
}

.kb-section-label {
    font-weight: bold;
    font-size: 14px;
    margin-top: 16px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.kb-diagram-link {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px 4px;
    border: 1px solid #000;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.kb-diagram-link:hover {
    background: #000;
    color: #fff;
}

.kb-related-link {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px 4px;
    border: 1px solid #666;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s, color 0.2s;
}

.kb-related-link:hover {
    background: #333;
    color: #fff;
}

.kb-also-item {
    padding: 8px 12px;
    margin: 4px 0;
    border-left: 3px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
}

.kb-also-item:hover {
    border-color: #000;
    background: #f0f0f0;
}

.kb-topics-tree {
    margin-top: 12px;
}

.kb-topic-group {
    margin-bottom: 16px;
}

.kb-topic-name {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.kb-subtopic-name {
    font-weight: bold;
    font-size: 15px;
    color: #555;
    margin: 8px 0 4px 8px;
}

.kb-topic-entry {
    padding: 4px 8px 4px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.2s;
}

.kb-topic-entry:hover {
    color: #000;
    text-decoration: underline;
}

/* ---- alphaTab: Guitar Pro Tab Section ---- */
.kb-tab-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}

.kb-tab-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    align-items: center;
}

.kb-tab-btn {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
    padding: 6px 0;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    width: 36px;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

.kb-tab-btn:hover {
    background: #000;
    color: #fff;
}

.kb-tab-select {
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 14px;
    padding: 5px 10px;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.kb-tab-tempo {
    width: 56px;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 14px;
    padding: 5px 6px;
    border: 2px solid #000;
    border-radius: 4px;
    text-align: center;
    -moz-appearance: textfield;
}

.kb-tab-tempo::-webkit-inner-spin-button,
.kb-tab-tempo::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kb-tab-tempo-label {
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    color: #666;
}

.kb-oct-active {
    background: #000 !important;
    color: #fff !important;
}

.kb-tab-tempo-hint {
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-style: italic;
    color: #999;
    padding: 4px 8px 0;
}

.kb-tab-render {
    width: 100%;
    overflow: hidden;
    min-height: 100px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kb-tab-link {
}

.kb-tab-link:hover {
    background: #000;
    color: #fff;
}

.kb-pdf-row {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}

/* Clickable chat history — user messages are re-runnable */
.clickable-history {
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.clickable-history:hover {
    background: #e8e8e8 !important;
    border-left: 3px solid #000;
}

#kb-input {
    flex: 1;
    font-family: Lato, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #000;
    background: #fff;
    border-radius: 4px;
}

#kb-input:focus {
    outline: none;
    border-color: #444;
}

/* ============================================================
   RESPONSIVE — TABLET (768-1024px)
   ============================================================ */

@media (max-width: 1024px) {
    .v2-display {
        flex-direction: column;
    }

    .v2-notation-panel {
        width: 100%;
        min-width: unset;
    }

    .v2-container {
        max-width: 100%;
        padding: 0 16px 40px;
    }

    main {
        max-width: 100%;
        padding: 30px 16px;
    }

    header h1 {
        font-size: 36px;
    }

    .dice-row {
        flex-wrap: wrap;
    }
}

/* ============================================================
   RESPONSIVE — PHONE (<768px)
   ============================================================ */

@media (max-width: 768px) {
    header {
        padding: 30px 16px 20px;
    }

    header h1 {
        font-size: 28px;
        letter-spacing: 2px;
    }

    header .tagline {
        font-size: 14px;
    }

    h2 {
        font-size: 22px;
    }

    .intro h2 {
        font-size: 24px;
    }

    .intro p, .cboard-intro p, .v2-intro p {
        font-size: 15px;
    }

    .generator, .v2-generator {
        padding: 20px 12px;
    }

    .chat-input-row {
        flex-wrap: wrap;
    }

    #chat-input, #cb-input, #v2-input, #fb-input {
        font-size: 16px;  /* prevents iOS zoom on focus */
        flex: 1 1 0;
        min-width: 0;
    }

    .mic-btn {
        flex: 0 0 auto;
    }

    #generate-btn, .cb-generate-btn {
        width: 100%;
        padding: 14px;
        flex: 0 0 100%;
    }

    .dice-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dice-btn {
        font-size: 14px;
        padding: 8px 14px;
    }

    .dice-label {
        font-size: 11px;
    }

    .v2-display {
        flex-direction: column;
        padding: 10px;
        gap: 12px;
    }

    .v2-notation-panel {
        width: 100%;
        min-width: unset;
        min-height: 240px;
    }

    .v2-octave-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .v2-oct-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .v2-download-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cb-download-btn {
        font-size: 14px;
        padding: 8px 16px;
    }

    .chat-log {
        max-height: 200px;
    }

    .kb-tab-controls {
        gap: 4px;
    }

    .kb-tab-btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    .kb-tab-select {
        font-size: 12px;
        padding: 4px 6px;
    }

    .kb-tab-render {
        overflow-x: auto;
    }
}

footer {
    text-align: center;
    padding: 30px 20px;
    background: #000;
    color: #666;
    font-size: 14px;
}

/* PDF Collector */
.pdf-collector-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.4);
    font-family: Lato, 'Segoe UI', sans-serif;
    animation: traySlideUp 0.3s ease-out;
}
@keyframes traySlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.pdf-collector-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.pdf-collector-label span {
    color: #4CAF50;
    font-size: 16px;
}
.pdf-collector-btn {
    padding: 6px 14px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
}
.pdf-collector-btn:hover {
    background: #444;
}
.pdf-collector-go {
    background: #2E7D32;
    border-color: #4CAF50;
}
.pdf-collector-go:hover {
    background: #388E3C;
}
.pdf-collector-clear {
    background: #555;
    border-color: #777;
    margin-left: auto;
}
.pdf-collector-clear:hover {
    background: #C62828;
    border-color: #E53935;
}
.pdf-collect-btn {
    min-width: 130px;
    text-align: center;
}
/* Undo/Redo split button — matches .dice-btn height and style */
.ur-btn {
    display: inline-flex;
    align-items: stretch;
    border: 2px solid #000;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: top;
}
.ur-half {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Agency FB', Impact, sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: #000;
    background: #fff;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}
.ur-half:hover {
    background: #000;
    color: #fff;
}
.ur-left {
    border-right: 2px solid #000;
}

.fb-crosshair {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cline x1='16' y1='0' x2='16' y2='12' stroke='%23333' stroke-width='1.5'/%3E%3Cline x1='16' y1='20' x2='16' y2='32' stroke='%23333' stroke-width='1.5'/%3E%3Cline x1='0' y1='16' x2='12' y2='16' stroke='%23333' stroke-width='1.5'/%3E%3Cline x1='20' y1='16' x2='32' y2='16' stroke='%23333' stroke-width='1.5'/%3E%3Ccircle cx='16' cy='16' r='5' fill='none' stroke='%23E53935' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, crosshair;
}
.pdf-collector-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}
.pdf-collector-thumb {
    width: 60px;
    height: 40px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #555;
    border-radius: 2px;
    flex-shrink: 0;
}
.ks-collector-tray {
    bottom: 46px;
    background: #1a1a2e;
}
.ks-collector-tray .pdf-collector-label span {
    color: #FFD600;
}

/* Back to ASK floating button */
.back-to-ask-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #000;
    color: #fff;
    border: 2px solid #FFD600;
    padding: 10px 18px;
    font-family: 'Agency FB', sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 9999;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.back-to-ask-btn:hover {
    background: #FFD600;
    color: #000;
}
