/* ========================================
   Frame Calculator - Global Styles
   Modern, Squarespace-inspired design
   ======================================== */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #0d7377;
    --accent-light: #14919b;
    --accent-subtle: #e8f4f4;
    --border: #eeeeee;
    --border-strong: #dddddd;
    --error: #c0392b;
    --error-bg: #fdf2f2;
    --success: #27ae60;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Spacing */
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #14919b;
    --accent-light: #1fb8c4;
    --accent-subtle: #0d2a2b;
    --border: #222222;
    --border-strong: #333333;
    --error: #e74c3c;
    --error-bg: #2d1515;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input {
    font-family: inherit;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .header {
    background: rgba(10, 10, 10, 0.85);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mark svg {
    width: 16px;
    height: 16px;
    stroke: white;
    fill: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Theme Toggle Icons */
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.mobile-nav:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* ===== MOBILE NAV CATEGORIES ===== */
.mobile-nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0 0.25rem;
    border-bottom: none;
}

.mobile-nav-section-title:first-child {
    padding-top: 0;
}

/* ===== DIRECTORY DROPDOWN ===== */
.directory-btn {
    position: relative;
}

.directory-dropdown {
    position: fixed;
    top: var(--header-height);
    right: 0;
    z-index: 90;
    width: 300px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: directorySlideIn 0.15s ease;
}

[data-theme="dark"] .directory-dropdown {
    background: rgba(10, 10, 10, 0.97);
}

.directory-dropdown[hidden] {
    display: none;
}

@keyframes directorySlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.directory-content {
    padding: 1.25rem;
}

.directory-section {
    margin-bottom: 1.5rem;
}

.directory-section:last-child {
    margin-bottom: 0;
}

.directory-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.625rem;
}

.directory-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.directory-link {
    display: block;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.directory-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.directory-link.current {
    color: var(--accent);
    font-weight: 500;
}

/* ===== HOW TO USE SECTION ===== */
.how-to-section {
    max-width: 800px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem;
}

.how-to-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.how-to-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.how-to-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.how-to-step {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 50%;
    margin-top: 1px;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.step-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== MAIN LAYOUT ===== */
.main {
    padding-top: var(--header-height);
}

/* ===== HERO ===== */
.hero {
    padding: 4rem 2rem 3rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== CALCULATOR CONTAINER ===== */
.calculator-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ===== INPUT PANEL ===== */
.input-panel {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ===== UNIT TOGGLE ===== */
.unit-toggle {
    display: inline-flex;
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 3px;
}

.unit-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.unit-btn:hover {
    color: var(--text-secondary);
}

.unit-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ===== MODE TABS ===== */
.mode-tabs {
    display: flex;
    gap: 4px;
}

.mode-tab {
    flex: 1;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all var(--transition-fast);
}

.mode-tab:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.mode-tab.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.mode-tab-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.mode-tab.active .mode-tab-icon {
    color: var(--accent);
}

.mode-tab-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.mode-tab.active .mode-tab-label {
    color: var(--accent);
}

/* ===== INPUT GROUPS ===== */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-grid.single {
    grid-template-columns: 1fr;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-field:hover {
    border-color: var(--border-strong);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-field[type="number"] {
    -moz-appearance: textfield;
}

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== HELP TRIGGER ===== */
.help-trigger {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all var(--transition-fast);
}

.help-trigger:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

.help-link,
.help-link-btn {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: text-decoration-color var(--transition-fast);
}

.help-link:hover,
.help-link-btn:hover {
    text-decoration-color: var(--accent);
}

/* ===== INPUT HINT ===== */
.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== READONLY INPUT ===== */
.input-field[readonly] {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ===== LOCK BUTTON ===== */
.input-wrapper.has-lock {
    position: relative;
}

.input-wrapper.has-lock .input-field {
    padding-right: 70px;
}

.lock-btn {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lock-btn:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

.lock-btn .lock-icon.unlocked {
    display: none;
}

.lock-btn.unlocked .lock-icon.locked {
    display: none;
}

.lock-btn.unlocked .lock-icon.unlocked {
    display: block;
}

.lock-btn.unlocked {
    background: var(--accent-subtle);
    color: var(--accent);
}

/* ===== HOOK SELECTOR ===== */
.hook-selector {
    display: flex;
    gap: 8px;
}

.hook-option {
    flex: 1;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all var(--transition-fast);
}

.hook-option:hover {
    border-color: var(--border-strong);
}

.hook-option.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.hook-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.hook-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.hook-option.active .hook-dot {
    background: var(--accent);
}

.hook-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hook-option.active .hook-label {
    color: var(--accent);
}

/* ===== SEGMENTED CONTROL ===== */
.segmented-control {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.segment-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.segment-btn:hover {
    color: var(--text-secondary);
}

.segment-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ===== CONDITIONAL SECTIONS ===== */
.conditional-input[hidden],
.conditional-section[hidden] {
    display: none;
}

/* ===== RESULTS PANEL ===== */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== DIAGRAM ===== */
.diagram-card {
    overflow: hidden;
}

.diagram-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagram-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.diagram-views {
    display: flex;
    gap: 4px;
}

.view-btn {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.diagram-canvas {
    padding: 2rem;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.diagram-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
    color: var(--text-primary);
}

/* ===== ERROR BOX ===== */
.error-box {
    display: flex;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    align-items: flex-start;
}

.error-box[hidden] {
    display: none;
}

.error-icon {
    flex-shrink: 0;
    color: var(--error);
    margin-top: 1px;
}

.error-text {
    font-size: 0.875rem;
    color: var(--error);
    line-height: 1.5;
}

/* ===== RESULTS GRID ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: box-shadow var(--transition-normal);
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
}

.result-card.primary {
    background: var(--accent);
    border-color: var(--accent);
    grid-column: span 2;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.result-card.primary .result-label {
    color: rgba(255, 255, 255, 0.7);
}

.result-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.result-card.primary .result-value {
    color: white;
    font-size: 2rem;
}

.result-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.result-card.primary .result-desc {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== MULTI-HOOK RESULTS ===== */
.multi-hook-results {
    padding: 1.25rem;
}

.multi-hook-results[hidden] {
    display: none;
}

.multi-hook-results .section-header {
    margin-bottom: 1rem;
}

.hook-positions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hook-position {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.hook-position-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hook-position-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent);
}

/* ===== FRAME TABLE ===== */
.frame-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.frame-table[hidden] {
    display: none;
}

.frame-table-header {
    display: grid;
    grid-template-columns: 60px repeat(3, 1fr);
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.frame-table-header span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.frame-table-body {
    max-height: 300px;
    overflow-y: auto;
}

.frame-table-row {
    display: grid;
    grid-template-columns: 60px repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.frame-table-row:last-child {
    border-bottom: none;
}

.frame-number {
    font-weight: 600;
    color: var(--accent);
}

.frame-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== REASSURANCE BOX ===== */
.reassurance {
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.reassurance-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}

.reassurance-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.reassurance-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: fixed;
    z-index: 1000;
    max-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
}

.tooltip[hidden] {
    display: none;
}

.tooltip-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tooltip-content strong {
    color: var(--text-primary);
    font-weight: 500;
}

.tooltip-diagram {
    margin-bottom: 0.75rem;
}

.tooltip-diagram svg {
    width: 100%;
    height: 80px;
    color: var(--text-primary);
}

.tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(135deg);
    left: 20px;
    top: -6px;
}

.tooltip-link {
    display: inline-block;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.tooltip-link:hover {
    opacity: 0.8;
}

/* ===== MULTI-HOOK OPTIONS ===== */
.multi-hook-options {
    padding-top: 0.5rem;
}

.multi-hook-options[hidden] {
    display: none;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .input-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .directory-btn {
        display: none;
    }

    .directory-dropdown {
        width: 260px;
    }

    .how-to-section {
        padding: 0 1rem;
    }

    .how-to-card {
        padding: 1.5rem;
    }

    .hero {
        padding: 3rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .calculator-container {
        padding: 0 1rem 3rem;
    }

    .card-section {
        padding: 1.25rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-card.primary {
        grid-column: span 1;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .result-card.primary .result-value {
        font-size: 1.75rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    .hook-selector {
        flex-wrap: wrap;
    }

    .hook-option {
        flex: 1 1 calc(50% - 4px);
    }

    .mode-tabs {
        flex-wrap: wrap;
    }

    .mode-tab {
        flex: 1 1 calc(33% - 4px);
    }
}

/* ===== INSPIRATION SECTION ===== */
.inspiration-section {
    padding: 3rem 2rem;
    background: var(--bg-secondary);
}

.inspiration-content {
    max-width: 800px;
    margin: 0 auto;
}

.inspiration-section .article-image-wrapper {
    margin: 0;
}

.inspiration-section .article-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
}

@media (max-width: 768px) {
    .inspiration-section {
        padding: 2rem 1rem;
    }
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.action-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-secondary);
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.action-btn:hover svg {
    opacity: 1;
}

@media (max-width: 640px) {
    .action-buttons {
        justify-content: center;
    }

    .action-btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
        min-width: 120px;
    }
}

@media (max-width: 380px) {
    .action-btn span {
        display: none;
    }

    .action-btn {
        flex: 0;
        min-width: auto;
        padding: 0.625rem;
    }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    color: white;
    background: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-secondary {
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-danger {
    color: white;
    background: var(--error);
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Saved List */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.saved-item:hover {
    border-color: var(--border-strong);
}

.saved-item-info {
    flex: 1;
    min-width: 0;
}

.saved-item-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.saved-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.saved-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.saved-item-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.saved-item-btn.delete:hover {
    color: var(--error);
    border-color: var(--error);
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease, fadeOut 0.3s ease 2.5s forwards;
}

.toast[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide non-essential elements */
    .header,
    .footer,
    .input-panel,
    .action-buttons,
    .diagram-views,
    .view-btn,
    .reassurance,
    .tooltip,
    .modal-overlay,
    .toast,
    .directory-dropdown,
    .directory-btn,
    .how-to-section {
        display: none !important;
    }

    /* Reset page layout */
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .main {
        padding: 0;
    }

    .calculator-container {
        max-width: 100%;
        padding: 0;
    }

    .calculator-grid {
        display: block;
    }

    .results-panel {
        padding: 0;
    }

    /* Diagram */
    .diagram-card {
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .diagram-header {
        border-bottom: 1px solid #ccc;
    }

    /* Results */
    .results-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .result-card {
        border: 1px solid #ccc;
        box-shadow: none;
        padding: 0.75rem;
    }

    .result-card.primary {
        grid-column: span 2;
        background: #f5f5f5;
    }

    .result-label {
        color: #666;
    }

    .result-value {
        color: black;
    }

    /* Multi-hook results */
    .multi-hook-results {
        border: 1px solid #ccc;
        box-shadow: none;
        margin-top: 1rem;
        page-break-inside: avoid;
    }

    /* Frame table */
    .frame-table {
        border: 1px solid #ccc;
        margin-top: 1rem;
        page-break-inside: avoid;
    }

    .frame-table-header,
    .frame-table-row {
        border-bottom: 1px solid #ccc;
    }

    /* Print header */
    .hero {
        display: block !important;
        text-align: center;
        padding: 1rem 0;
        border-bottom: 2px solid black;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 18pt;
        margin: 0;
    }

    .hero p {
        display: none;
    }
}
