/* ============================================
   Tactile Puzzle Generator - Kid-Friendly Styles
   ============================================ */

:root {
    /* Vibrant kid-friendly colors */
    --color-primary: #f49c00;
    --color-primary-light: #ffb833;
    --color-secondary: #f49c00;
    --color-accent: #f49c00;
    --color-warning: #fbbf24;
    --color-danger: #f87171;

    /* Board colors */
    --tile-empty: #f0f9ff;
    --tile-obstacle: #94a3b8;
    --tile-start: #22c55e;
    --tile-goal: #eab308;
    --tile-path: #e0f2fe;

    /* UI colors */
    --bg-main: #3b82c4;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-dark: rgba(30, 30, 45, 0.95);
    --text-primary: #3b82c4;
    --text-secondary: #3b82c4;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);

    /* Sizing */
    --tile-size: 70px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

/* Dark mode */
[data-theme="dark"] {
    --bg-main: #3b82c4;
    --bg-card: rgba(30, 30, 50, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --tile-empty: #1e293b;
    --tile-path: #334155;
}

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

body {
    font-family: Verdana, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Responsive board scaling for mobile */
@media (max-width: 600px) {
    :root {
        --tile-size: 12vw;
    }

    .board {
        padding: 0.5rem;
        gap: 2px;
    }

    .board-wrapper {
        max-width: 100%;
    }

    .container {
        padding: 0.5rem;
    }

    .card {
        padding: 0.75rem;
    }

    .tile.obstacle::after {
        font-size: 1rem;
    }

    .obstacle-emoji {
        font-size: 1.3rem;
    }

    .obstacle-emoji.emoji-mushroom {
        font-size: 1rem;
    }

    .coord-label {
        font-size: 0.4rem;
    }
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header .icon {
    font-size: 1.5rem;
}

/* ============================================
   Controls
   ============================================ */

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-btn.active {
    background: #f49c00;
    color: white;
    border-color: #f49c00;
}

.generate-btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: #f49c00;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(244, 156, 0, 0.4);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn .icon {
    font-size: 1.4rem;
    animation: sparkle 2s infinite;
}

/* Activity Book Button */
.activity-book-btn {
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.activity-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.activity-book-btn:active {
    transform: translateY(-1px);
}

.activity-book-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Feedback Button */
.feedback-btn {
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.feedback-btn:active {
    transform: translateY(-1px);
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }
}

/* ============================================
   Game Board
   ============================================ */

.board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.board-wrapper {
    position: relative;
    display: inline-block;
}

.path-arrow {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

.path-arrow svg {
    display: block;
}

.board {
    display: grid;
    gap: 8px;
    padding: 2.5rem;
    background: #3b82c4;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.board.size-3x4 {
    grid-template-columns: repeat(4, var(--tile-size));
    grid-template-rows: repeat(3, var(--tile-size));
}

.board.size-4x6 {
    grid-template-columns: repeat(6, var(--tile-size));
    grid-template-rows: repeat(4, var(--tile-size));
}

.tile {
    width: var(--tile-size);
    height: var(--tile-size);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    pointer-events: none;
    border-radius: inherit;
}

.tile.empty {
    background: var(--tile-empty);
}

.tile.obstacle {
    background: linear-gradient(135deg, #94a3b8, #94a3b8);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.tile.obstacle::after {
    content: none;
}

.obstacle-emoji {
    font-size: 2.34rem;
    position: relative;
    z-index: 5;
}

.obstacle-emoji.emoji-mushroom {
    font-size: 1.8rem;
}

.tile.start {
    background: linear-gradient(135deg, var(--tile-start), #16a34a);
}

.tile.goal {
    background: linear-gradient(135deg, var(--tile-goal), #ca8a04);
}

/* SVG images for start and goal tiles */
.tile-svg {
    width: 136%;
    height: 136%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Bump start characters higher to center them better */
.tile.start .tile-svg {
    top: 40%;
}

.tile.path {
    background: var(--tile-path);
    border: 2px dashed rgba(99, 102, 241, 0.3);
}

/* ============================================
   Solution Display
   ============================================ */

.solution-container {
    width: 100%;
}

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

.solution-buttons {
    display: flex;
    gap: 0.5rem;
}

.solution-toggle {
    padding: 0.5rem 1rem;
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.solution-toggle:hover {
    transform: scale(1.05);
}

.export-btn {
    padding: 0.5rem 1rem;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: scale(1.05);
    background: #7c3aed;
}

.solution-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(59, 130, 196, 0.05);
    border-radius: var(--border-radius-sm);
    border: 2px dashed rgba(59, 130, 196, 0.2);
    overflow-x: auto;
}

.solution-steps.hidden {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

/* Block Chain - Visual puzzle piece display */
.block-chain {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
}

.block-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: -10px;
    /* Tighter connection between blocks */
    /* Less overlap - blocks connect without overlapping too much */
}

.block-wrapper:first-child {
    margin-left: 0;
}

.solution-block {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Repeat blocks attach below their parent block */
.repeat-block {
    height: 50px;
    width: 62px;
    margin-top: -15px;
    /* Higher - closer to parent */
    margin-left: -7px;
    /* Shift left to center under parent */
}

@media (max-width: 600px) {
    .solution-block {
        height: 40px;
    }

    .block-wrapper {
        margin-left: -5px;
    }

    .repeat-block {
        height: 32px;
        width: 42px;
        margin-top: -8px;
    }
}

/* ============================================
   Piece Inventory
   ============================================ */

.inventory {
    margin-top: 1.5rem;
}

.inventory h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
}

.inventory-item .count {
    font-weight: 700;
    color: var(--color-primary);
}

.inventory-item.used {
    background: rgba(34, 197, 94, 0.1);
}

.inventory-item.used .count {
    color: var(--color-accent);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ============================================
   Print Styles
   ============================================ */

/* Print Styles are consolidated at the bottom of the file */

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

.tile {
    animation: fadeIn 0.3s ease;
    animation-fill-mode: both;
}

.board .tile:nth-child(1) {
    animation-delay: 0.05s;
}

.board .tile:nth-child(2) {
    animation-delay: 0.1s;
}

.board .tile:nth-child(3) {
    animation-delay: 0.15s;
}

.board .tile:nth-child(4) {
    animation-delay: 0.2s;
}

.board .tile:nth-child(5) {
    animation-delay: 0.25s;
}

.board .tile:nth-child(6) {
    animation-delay: 0.3s;
}

.board .tile:nth-child(7) {
    animation-delay: 0.35s;
}

.board .tile:nth-child(8) {
    animation-delay: 0.4s;
}

.board .tile:nth-child(9) {
    animation-delay: 0.45s;
}

.board .tile:nth-child(10) {
    animation-delay: 0.5s;
}

.board .tile:nth-child(11) {
    animation-delay: 0.55s;
}

.board .tile:nth-child(12) {
    animation-delay: 0.6s;
}

/* ============================================
   Puzzle Setup Display
   ============================================ */

.puzzle-setup {
    width: 100%;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.setup-section {
    margin-bottom: 1rem;
}

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

.setup-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setup-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.setup-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.setup-item.start {
    border-left: 4px solid var(--tile-start);
}

.setup-item.goal {
    border-left: 4px solid var(--tile-goal);
}

.setup-icon {
    font-size: 1.25rem;
}

.setup-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.setup-pos {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.obstacle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.obstacle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.setup-section.efficiency {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(16, 185, 129, 0.1));
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.setup-section.efficiency p {
    margin: 0;
    font-size: 0.95rem;
}

.setup-section.efficiency strong {
    color: var(--color-accent);
}

/* Challenge Section */
.setup-section.challenge-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid #8b5cf6;
}

.setup-section.challenge-section h4 {
    color: #8b5cf6;
}

.challenge-desc {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.challenge-piece {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0.15rem;
}

.loop-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    animation: pulse-loop 2s infinite;
}

@keyframes pulse-loop {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
    }

    50% {
        box-shadow: 0 0 16px rgba(236, 72, 153, 0.7);
    }
}

/* Loop Structure Display */
.loop-structure {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.structure-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

.structure-badge.pre {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.structure-badge.post {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.structure-arrow {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 700;
}

/* ============================================
   Coordinate Labels on Tiles
   ============================================ */

.coord-label {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    z-index: 1;
}

.tile.obstacle .coord-label,
.tile.start .coord-label,
.tile.goal .coord-label {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Solution Summary
   ============================================ */

.solution-summary {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.1));
    border-radius: var(--border-radius-sm);
    margin-top: 0.5rem;
    text-align: center;
}

.solution-summary .summary-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.solution-summary strong {
    color: var(--color-primary);
}

/* ============================================
   Export Template Styles (PNG-based)
   ============================================ */

.export-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: white;
    overflow: auto;
}

.export-container.active {
    display: block;
}

/* A4 Page with PNG background */
.export-page {
    width: 595px;
    height: 842px;
    position: relative;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto;
}

/* Board positioned on template */
.export-board {
    position: absolute;
    display: grid;
    gap: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.export-board .tile {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff2cc;
    overflow: visible;
}

.export-board .tile.obstacle {
    background: linear-gradient(135deg, #94a3b8, #94a3b8);
}

.export-board .tile.obstacle::after {
    content: none;
}

.export-board .obstacle-emoji {
    font-size: 2.34rem;
}

.export-board .obstacle-emoji.emoji-mushroom {
    font-size: 1.8rem;
}

.export-board .tile.start {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.export-board .tile.goal {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.export-board .tile-svg {
    width: 136%;
    height: 136%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.export-board .tile.start .tile-svg {
    top: 40%;
}

/* Text overlays for page 1 */
.export-text-blue {
    position: absolute;
    top: 90px;
    left: 30px;
    right: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #3b82c4;
    line-height: 1.4;
    margin: 0;
}

.export-text-orange {
    position: absolute;
    top: 175px;
    left: 30px;
    right: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #f59e0b;
    line-height: 1.4;
    margin: 0;
}

.export-board-1 {
    top: 470px;
}

.export-board-2 {
    top: 300px;
}

/* Arrow overlay */
.export-arrow {
    position: absolute;
    top: 300px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Solution blocks positioned on template */
.export-blocks {
    position: absolute;
    bottom: 395px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

/* Remove transparency from export board tiles */
.export-board .tile {
    opacity: 1 !important;
    background-color: #fff2cc !important;
}

.export-board .tile::before {
    display: none !important;
    content: none !important;
}

.export-board .tile.obstacle {
    background: #94a3b8 !important;
}

.export-board .tile.start {
    background: #22c55e !important;
}

.export-board .tile.goal {
    background: #eab308 !important;
}

/* Print styles - remove browser headers/footers */
@page {
    margin: 0;
    size: A4 portrait;
}

@media print {

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .container,
    header,
    .main-content {
        display: none !important;
    }

    .export-container {
        display: block !important;
        position: static;
        background: white;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .export-page {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 auto !important;
        page-break-after: always;
        /* Legacy */
        break-after: page;
        /* Modern */
        page-break-inside: avoid;
        break-inside: avoid;
        background-size: 100% 100% !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        position: relative;
    }

    /* Prevent blank page after the last page */
    .export-page:last-child {
        page-break-after: auto;
    }

    /* Hide loading overlay when printing */
    .loading-overlay {
        display: none !important;
    }
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-header h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f49c00;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.feedback-status {
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    min-height: 1.5rem;
}

.feedback-status.success {
    color: #10b981;
}

.feedback-status.error {
    color: #ef4444;
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 20000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    max-width: 400px;
    padding: 2rem;
}

.loading-blocks {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
    justify-content: center;
}

.loading-block {
    width: 60px;
    height: 60px;
    animation: bounce 1s infinite alternate ease-in-out;
}

.loading-block.delay-1 {
    animation-delay: 0s;
}

.loading-block.delay-2 {
    animation-delay: 0.15s;
}

.loading-block.delay-3 {
    animation-delay: 0.3s;
}

.loading-block.delay-4 {
    animation-delay: 0.45s;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-20px);
    }
}

#loading-text {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

#loading-subtext {
    color: var(--text-secondary);
    font-size: 1rem;
}