/* ========================================
   Telegram Style - Spoiler Decoder
   Clean, minimal design inspired by telegram.org
   ======================================== */

/* CSS Variables - Telegram Color Palette */
:root {
    /* Telegram Brand Colors */
    --tg-primary: #0088cc;
    --tg-primary-hover: #179cde;
    --tg-primary-active: #0074aa;
    
    /* Backgrounds */
    --tg-bg: #ffffff;
    --tg-bg-alt: #f3f6fb;
    --tg-border: #e3e6eb;
    
    /* Text Colors */
    --tg-text-main: #222222;
    --tg-text-muted: #6f7b8a;
    --tg-link: #0088cc;
    --tg-link-hover: #179cde;
    
    /* Accent */
    --tg-accent-soft: #a19679;
    
    /* Shadows */
    --tg-shadow-sm: 0 2px 6px rgba(0, 136, 204, 0.35);
    --tg-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    
    /* Braille */
    --braille-font-size: 24px;
}

/* ========================================
   Global Styles & Typography
   ======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tg-text-main);
    background: var(--tg-bg);
    margin: 0;
    padding: 0;
}

/* Headings */
h1 {
    font-size: 36px;
    font-weight: 500;
    margin: 0 0 16px;
    color: var(--tg-text-main);
}

h2 {
    font-size: 28px;
    font-weight: 500;
    margin: 40px 0 16px;
    color: var(--tg-text-main);
}

h3 {
    font-size: 22px;
    font-weight: 500;
    margin: 32px 0 12px;
    color: var(--tg-text-main);
}

p {
    margin: 0 0 16px;
}

a {
    color: var(--tg-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--tg-link-hover);
}

/* ========================================
   Header - Telegram Style
   ======================================== */

.tg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--tg-bg);
    border-bottom: 1px solid var(--tg-border);
}

.tg-header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.tg-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tg-text-main);
}

.tg-logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-text-main);
}

.tg-logo a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.tg-logo a:hover {
    opacity: 0.8;
}

/* Header Actions Container */
.tg-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* What is it? Button */
.tg-btn-what-is-it {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid var(--tg-border);
    background: var(--tg-bg);
    color: var(--tg-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tg-btn-what-is-it:hover {
    border-color: var(--tg-primary);
    color: var(--tg-primary);
}

/* Language Switcher - Telegram Style */
.tg-lang-switcher {
    position: relative;
}

.tg-lang-current {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid var(--tg-border);
    background: var(--tg-bg);
    color: var(--tg-text-muted);
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.tg-lang-current:hover {
    border-color: var(--tg-primary);
    color: var(--tg-primary);
}

.tg-lang-caret {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.tg-lang-switcher.open .tg-lang-caret {
    transform: rotate(180deg);
}

.tg-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    background: var(--tg-bg);
    border-radius: 8px;
    border: 1px solid var(--tg-border);
    box-shadow: var(--tg-shadow-md);
    padding: 4px 0;
    display: none;
}

.tg-lang-switcher.open .tg-lang-menu {
    display: block;
}

.tg-lang-menu button {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--tg-text-main);
    transition: background 0.1s ease;
}

.tg-lang-menu button:hover {
    background: var(--tg-bg-alt);
}

.tg-lang-menu button.active {
    font-weight: 600;
    color: var(--tg-primary);
}

/* ========================================
   Buttons - Telegram Style
   ======================================== */

.tg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-width: 180px;
    line-height: 1.5;
    user-select: none;
}

.tg-btn i {
    font-size: 16px;
}

/* Primary Button */
.tg-btn-primary {
    background: #1d98dc;
    color: #ffffff;
    border-color: #357ebd;
}

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

.tg-btn-primary:active {
    background: var(--tg-primary-active);
    transform: translateY(1px);
}

/* Secondary Button */
.tg-btn-secondary {
    background: var(--tg-bg);
    color: var(--tg-primary);
    border: 1px solid var(--tg-primary);
}

.tg-btn-secondary:hover {
    background: rgba(0, 136, 204, 0.06);
}

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

/* Ghost Button */
.tg-btn-ghost {
    background: transparent;
    color: var(--tg-link);
    padding: 8px 16px;
    min-width: auto;
}

.tg-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Button sizes */
.tg-btn-lg {
    padding: 12px 20px;
    font-size: 16px;
    min-width: 200px;
}

.tg-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-width: auto;
}

/* Disabled state */
.tg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Layout - Containers & Sections
   ======================================== */

.tg-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
}

.tg-section {
    padding: 40px 16px;
}

.tg-section-alt {
    padding: 40px 16px;
    background: var(--tg-bg-alt);
}

/* Screen Management */
.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: block;
    opacity: 1;
}

.screen-content {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 16px;
}

.screen-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--tg-text-main);
    text-align: center;
}

/* ========================================
   Upload Screen Components
   ======================================== */

.privacy-note {
    text-align: center;
    margin-bottom: 24px;
    color: var(--tg-text-muted);
    font-size: 14px;
}

.privacy-note i {
    color: var(--tg-primary);
    margin-right: 4px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--tg-border);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--tg-bg);
}

.drop-zone:hover {
    border-color: var(--tg-primary);
    background: rgba(0, 136, 204, 0.02);
}

.drop-zone.drag-over {
    border-color: var(--tg-primary);
    background: rgba(0, 136, 204, 0.06);
    border-style: solid;
}

.drop-zone i {
    font-size: 48px;
    color: var(--tg-primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.drop-zone p {
    font-size: 14px;
    color: var(--tg-text-muted);
    margin-bottom: 16px;
}

/* Examples Section */
.examples-section {
    margin-top: 30px;
}

/* Upload Section */
.upload-section {
    margin-top: 30px;
}

/* Mobile Upload Button (hidden on desktop by default) */
.mobile-upload-button {
    display: none !important;
}

/* Desktop Drop Zone (visible on desktop by default) */
.drop-zone-desktop {
    display: block;
}

.examples-section > p {
    text-align: center;
    color: var(--tg-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.upload-section > p {
    text-align: center;
    color: var(--tg-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.example-card {
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--tg-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.example-card:hover {
    border-color: var(--tg-primary);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.15);
    transform: translateY(-2px);
}

.example-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ========================================
   Processing & Recognition Components
   ======================================== */

.processing-status {
    text-align: center;
    padding: 60px 20px;
}

.processing-status .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 3px;
    color: var(--tg-primary);
}

.processing-status p {
    margin-top: 20px;
    color: var(--tg-text-muted);
    font-size: 15px;
}

/* Manual ROI Section */
.manual-roi-section .alert {
    border-radius: 12px;
    border: 1px solid rgba(0, 136, 204, 0.3);
    background: rgba(0, 136, 204, 0.06);
    color: var(--tg-text-main);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.canvas-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    text-align: center;
}

.roi-canvas {
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    cursor: crosshair;
    width: 100%;
    height: auto;
    display: block;
}

.roi-info {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Recognition Result */
.recognition-result {
    text-align: center;
    padding: 20px 20px;
}

/* Visualization Container */
.visualization-container {
    margin: 10px auto 30px;
    max-width: 100%;
    text-align: center;
}

.visualization-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.braille-display {
    font-size: var(--braille-font-size);
    padding: 24px;
    background: var(--tg-bg-alt);
    border-radius: 12px;
    border: 1px solid var(--tg-border);
    min-height: 80px;
    margin: 24px 0;
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    word-break: break-all;
    color: var(--tg-text-main);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ========================================
   Edit Screen Components
   ======================================== */

.image-thumbnail-container {
    text-align: center;
    margin-bottom: 24px;
}

.img-thumbnail {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--tg-border);
}

.clickable-thumbnail {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-thumbnail:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.original-braille {
    background: var(--tg-bg-alt);
    padding: 12px;
    border-radius: 8px;
    font-size: 18px;
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    word-break: break-all;
    color: var(--tg-text-main);
    border: 1px solid var(--tg-border);
}

.braille-input {
    font-size: 18px;
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    line-height: 1.6;
    padding: 12px;
    border: 1px solid var(--tg-border);
    border-radius: 8px;
    width: 100%;
    resize: vertical;
    transition: border-color 0.15s ease;
}

/* Override form-control font-size for editableBraille */
#editableBraille {
    font-size: 18px !important;
}

.braille-input:focus {
    outline: none;
    border-color: var(--tg-primary);
}

/* Braille Keyboard */
.braille-keyboard-section {
    margin-top: 24px;
}

.braille-keyboard-section h6 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--tg-text-main);
}

.braille-keyboard {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--tg-bg-alt);
}

/* Last Used Symbols */
.last-used-symbols {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tg-border);
}

.last-used-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-text-muted);
    margin-bottom: 8px;
}

.last-used-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.last-used-btn {
    min-width: 40px;
}

.braille-row {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.braille-row .badge {
    min-width: 90px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--tg-primary);
    color: white;
    border-radius: 5px;
}

.braille-btn {
    padding: 8px 14px;
    border: 1px solid var(--tg-border);
    background: var(--tg-bg);
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    transition: all 0.15s ease;
    min-width: 44px;
    color: var(--tg-text-main);
}

.braille-btn:hover {
    background: var(--tg-primary);
    color: white;
    border-color: var(--tg-primary);
    transform: scale(1.05);
}

.braille-btn:active {
    transform: scale(0.95);
}

/* Keyboard Header and Mode Switcher */
.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.input-mode-switcher {
    display: flex;
    gap: 4px;
    background: var(--tg-bg-alt);
    border: 1px solid var(--tg-border);
    border-radius: 6px;
    padding: 2px;
}

.mode-switch-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--tg-text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.mode-switch-btn:hover {
    background: rgba(0, 136, 204, 0.1);
    color: var(--tg-primary);
}

.mode-switch-btn.active {
    background: var(--tg-primary);
    color: white;
}

.input-mode-container {
    display: block;
}

.input-mode-container[data-mode="touch"] {
    display: none;
}

.input-mode-container[data-mode="touch"].active {
    display: block !important;
}

.input-mode-container[data-mode="buttons"].active {
    display: block !important;
}

/* Touch Braille Keyboard */
.braille-touch-keyboard {
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    padding: 20px;
    background: var(--tg-bg-alt);
    min-height: 300px;
}

.touch-keyboard-hint {
    text-align: center;
    font-size: 13px;
    color: var(--tg-text-muted);
    margin-bottom: 16px;
}

.touch-keyboard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    min-height: 400px;
    margin: 20px 0;
    touch-action: none;
    padding: 20px;
}

/* Braille Dot Keys - Two columns */
.dot-key {
    width: 80px;
    height: 80px;
    background: #444;
    border-radius: 50%;
    color: #fff;
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    line-height: 80px;
    user-select: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.dot-key:hover {
    background: #555;
    transform: scale(1.1);
}

.dot-key:active,
.dot-key.touching {
    background: var(--tg-primary);
    transform: scale(0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.dot-key.pending {
    background: var(--tg-primary);
    opacity: 0.7;
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.4);
}

.braille-dots-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

/* Touch Keyboard Output */
.touch-keyboard-output {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 60px;
    padding: 12px;
    background: #fff;
    color: #000;
    font-size: 1.5em;
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    border: 1px solid var(--tg-border);
    border-radius: 8px;
    margin-top: 20px;
    word-break: break-all;
    box-sizing: border-box;
}

/* ========================================
   Result Screen Components
   ======================================== */

.dictionary-selector {
    margin-top: 24px;
}

.dictionary-selector select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tg-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tg-bg);
    color: var(--tg-text-main);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.dictionary-selector select:focus {
    outline: none;
    border-color: var(--tg-primary);
}

.decoded-result {
    background: rgba(0, 136, 204, 0.08);
    border: 1px solid var(--tg-primary);
    border-radius: 12px;
    padding: 32px;
    margin: 24px 0;
    min-height: 100px;
}

.decoded-text {
    font-size: 24px;
    font-weight: 500;
    color: var(--tg-primary-active);
    text-align: center;
    word-break: break-word;
}

.decoded-list {
    list-style-position: inside;
    padding: 0;
    margin: 0;
}

.decoded-list li {
    padding: 12px;
    margin: 8px 0;
    background: var(--tg-bg);
    border-radius: 8px;
    font-size: 16px;
    border: 1px solid var(--tg-border);
}

.replacement-char {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    border: 1px solid rgba(255, 193, 7, 0.5);
}

/* ========================================
   Forms & Inputs
   ======================================== */

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-text-main);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tg-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tg-bg);
    color: var(--tg-text-main);
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--tg-primary);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(0, 136, 204, 0.08);
    border: 1px solid rgba(0, 136, 204, 0.3);
    color: var(--tg-text-main);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--tg-text-main);
}

.alert i {
    margin-right: 8px;
    color: var(--tg-primary);
}

/* ========================================
   Image Modal
   ======================================== */

.tg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.tg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.tg-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 50px auto;
    text-align: center;
    z-index: 1001;
}

.tg-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s ease;
}

.tg-modal-close:hover {
    opacity: 0.7;
}

#modalImage {
    max-width: 100%;
    max-height: calc(100vh - 100px);
    height: auto;
    border-radius: 8px;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center {
    text-align: center;
    }
    
.text-muted {
    color: var(--tg-text-muted);
}

.text-primary {
    color: var(--tg-primary);
}

.small {
        font-size: 14px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.font-braille {
    font-family: 'Arial Unicode MS', Arial, sans-serif;
}

/* ========================================
   Loading & Spinners
   ======================================== */

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Custom Scrollbar
   ======================================== */

.braille-keyboard::-webkit-scrollbar {
    width: 8px;
}

.braille-keyboard::-webkit-scrollbar-track {
    background: var(--tg-bg);
    border-radius: 4px;
}

.braille-keyboard::-webkit-scrollbar-thumb {
    background: var(--tg-border);
    border-radius: 4px;
}

.braille-keyboard::-webkit-scrollbar-thumb:hover {
    background: var(--tg-text-muted);
}

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

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

.screen.active .screen-content {
    animation: fadeIn 0.4s ease-out;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    h1, .screen-title {
        font-size: 24px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .screen-content {
        margin: 20px auto;
    }
    
    .tg-section, .tg-section-alt {
        padding: 24px 12px;
    }
    
    /* Hide desktop drop zone on mobile */
    .drop-zone-desktop {
        display: none !important;
    }
    
    /* Show mobile upload button on mobile */
    .mobile-upload-button {
        display: block !important;
        text-align: center;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .examples-section {
        margin-top: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .tg-btn {
        width: 100%;
    }
    
    .braille-display {
        font-size: 20px;
        padding: 16px;
    }
    
    .braille-input {
        font-size: 18px;
    }
    
    .decoded-text {
        font-size: 20px;
    }
    
    .tg-logo-text {
        font-size: 16px;
    }
    
    .tg-header-actions {
        gap: 8px;
    }
    
    .tg-btn-what-is-it {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .braille-keyboard {
        max-height: 300px;
        padding: 12px;
    }
    
    .braille-btn {
        font-size: 18px;
        padding: 6px 10px;
        min-width: 38px;
    }
    
    .keyboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-mode-switcher {
        width: 100%;
        justify-content: stretch;
    }
    
    .mode-switch-btn {
        flex: 1;
        text-align: center;
    }
    
    .braille-touch-keyboard {
        min-height: 250px;
        padding: 16px;
    }
    
    .touch-keyboard-container {
        min-height: 200px;
        gap: 20px;
        padding: 10px;
    }
    
    .dot-key {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
        line-height: 60px;
    }
    
    .braille-dots-column {
        gap: 20px;
    }
    
    .touch-keyboard-output {
        font-size: 1.2em;
        min-height: 50px;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .tg-btn {
        padding: 10px 20px;
        font-size: 13px;
}

    .tg-btn-lg {
        padding: 12px 24px;
        font-size: 14px;
    }
}

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

/* Info Page Styles */
.info-page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.info-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--tg-text-main);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.3;
}

.info-image-container {
    text-align: center;
    margin: 30px 0;
}

.info-image {
    max-width: 70%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--tg-text-main);
    margin: 30px 0;
}

.info-text p {
    margin-bottom: 20px;
}

.info-text a {
    color: var(--tg-link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.info-text a:hover {
    border-bottom-color: var(--tg-link);
}

.info-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-actions {
    text-align: center;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .info-title {
        font-size: 24px;
    }
    
    .info-text {
        font-size: 15px;
    }
    
    .info-page-content {
        padding: 20px 15px;
    }
}

@media print {
    .tg-header,
    .action-buttons,
    .braille-keyboard {
        display: none;
    }
}
