@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --btn-font-size-main: 0.8rem;
    --btn-font-size-reduced: 0.75rem;
}

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

/* ~ ---- INI - FONTS ---- */
@font-face {
  font-family: 'NType82';
  src: url('fonts/NType82-Regular.otf');
}

@font-face {
  font-family: 'Ndot57';
  src: url('fonts/Ndot-57.otf');
}

@font-face {
  font-family: 'Ranyth';
  src: url('fonts/Ranyth.ttf');
}
/* ~ ---- END - FONTS ---- */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 20px 60px 20px;
    width: 100%;
    max-width: 120vw;
    overflow-x: hidden;
}

.main-content {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.preview-canvas {
    display: none;
}

/* ---------- INI - TOP ---------- */
/* Header Redesign */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow: visible;
}

/* Add padding to body to account for fixed header */
body {
    padding-top: 68px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.header-logo {
    display: flex;
    align-items: center;
}

.logo-link {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 28px;
    width: 28px;
    object-fit: cover;
    border-radius: 50%;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.header-nav {
    display: flex;
    gap: 10px;
}

.nav-tab {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    font-size: 0.9rem;
}

.nav-tab .tab-icon {
    width: 16px;
    height: 16px;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-tab:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.nav-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff4444;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.shortcuts-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.shortcuts-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.shortcuts-btn .btn-icon {
    width: 18px;
    height: 18px;
}

/* Modal icon styling */
.modal-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Responsive header styles */
@media (max-width: 768px) {
    .header {
        padding: 20px 15px 14px 15px;
    }
    
    body {
        padding-top: 68px;
    }
    
    .header-center {
        display: none;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 24px;
        width: 24px;
    }
    
    .nav-tab {
        padding: 6px 12px;
        font-size: 0.85rem;
        position: relative;
    }
    
    .nav-tab .tab-icon {
        width: 14px;
        height: 14px;
    }
    
    /* Adjust Coming Soon badge on mobile */
    .coming-soon {
        top: -6px;
        right: -8px;
    }
    
    /* Hide shortcuts button on mobile */
    .shortcuts-btn {
        display: none;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .header {
        padding: 35px 12px 12px 12px;
        overflow: visible;
        align-items: center;
    }
    
    body {
        padding-top: 82px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        margin-top: 10px;
    }
    
    .header-logo {
        display: flex;
        align-items: center;
    }
    
    .logo-link {
        display: flex;
        align-items: center;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        margin-top: 10px;
    }
    
    .header-nav {
        overflow: visible;
        display: flex;
        align-items: center;
    }
    
    .nav-tab {
        padding: 5px 10px;
        font-size: 0.8rem;
        overflow: visible;
        display: flex;
        align-items: center;
    }
    
    /* Ensure Coming Soon badge doesn't get cut off */
    .coming-soon {
        font-size: 8px;
        padding: 2px 4px;
    }
    
    .logo-img {
        height: 22px;
        width: 22px;
    }
    
    .logo-text {
        font-size: 0.95rem;
        line-height: 1;
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: #fff;
}

.header .main-title {
    font-family: NType82, sans-serif;
    font-size: 2rem;
    line-height: 1.8rem;
    font-weight: 100;
    letter-spacing: 0.1rem;
    word-spacing: 0.4rem;
    margin-top: 0.7rem;
}

.header p {
    font-size: 0.9rem;
    color: #999;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ? ---- INI - HYPERLINK --- */
a {
    color: inherit;
    text-decoration: underline;
}

a:visited { color: inherit; } 
a:hover   { opacity: .8; }
/* ? ---- END - HYPERLINK ---- */
/* ---------- END - TOP ---------- */

/* ---------- INI - GRID ---------- */
.grid-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
}

.grid-container {
    border: 1px solid #333;
    padding: 20px;
    background: #000;
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    gap: 4px;
    background: #111;
    padding: 1px;
    margin: 20 auto;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.pixel {
    width: 24px;
    height: 24px;
    background: #000;
    border-radius: 20%;
    cursor: crosshair;
    transition: all 0.1s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.pixel.active {
    background: #fff;
    border-color: #fff;
}

.pixel.inactive {
    background: #363636c5;
    border-color: #000;
    cursor: default;
    border: 2px solid #949393b4;
    opacity: 0.2;
}

.pixel:not(.inactive):hover {
    border-color: #666;
}

.grid-info {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Style Coordinates */
.grid-container::before {
    content: '(0,0)';
    position: absolute;
    top: -25px;
    left: 20px;
    font-size: 0.7rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.grid-container::after {
    content: '(24,24)';
    position: absolute;
    bottom: -25px;
    right: 20px;
    font-size:0.7rem;
    color: #666;
    font-family: 'Courier New', monospace;
}
/* ---------- END - GRID ---------- */

/* ---------- INI - CONTROLS ---------- */
.controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 420px;
}

.control-section {
    border: 1px solid #333;
    background: #000;
    transition: all 0.2s ease;
    width: 100%;
}

/* Collapsible behaviour */
.control-section.collapsed .control-content {
    display: none;
}

.control-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    background: #111;
    cursor: pointer;
    position: relative;
    width: 100%;
}

.control-header h3 {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
}

/* Arrow indicator */
.control-header::after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #999;
    transition: transform 0.2s ease;
}

.control-section.collapsed .control-header::after {
    transform: translateY(-50%) rotate(-90deg);
}

.control-content {
    padding: 20px 20px 20px 20px;
}

.control-content > *:last-child {
    margin-bottom: 0;
}

/*---------- INI - BUTTONS ----------*/
.btn {
    background: transparent;
    color: #fff;
    border: 1px solid #333;
    padding: 12px 20px;
    font-size: var(--btn-font-size-main);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

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

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

.btn.danger:hover {
    background: #d71921;
    color: #fff;
    border-color: #fff;
}

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

.btn.last {
    margin-bottom: 0;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px; /* Tabler icons use font-size */
}

.action-btn {
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: var(--btn-font-size-main);
    white-space: nowrap;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn .btn-icon {
    width: 17px;
    height: 14px;
    stroke-width: 2.5;
}

.history-btn {
    width: auto;
    min-width: 100px;
    margin-bottom: 0;
    font-size: var(--btn-font-size-main);
    padding: 10px 16px;
}

.history-btn .btn-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.btn:hover .btn-icon {
    stroke: currentColor;
}

.btn.primary:hover .btn-icon,
.btn.danger:hover .btn-icon {
    stroke: currentColor;
}
/*---------- END - BUTTONS ----------*/

/* ---------- INI - SELECTION MODE ---------- */
.pixel.selected {
    position: relative;
    box-shadow: 0 0 0 2px #ff4444, inset 0 0 0 1px #ff4444;
    z-index: 10;
}

.selection-mode .pixel {
    cursor: pointer !important;
}

.selection-mode .pixel:hover:not(.inactive) {
    box-shadow: 0 0 0 1px #ff444480;
}

/* Selection mode UI elements */
.mode-toggle-btn {
    background: transparent;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
    -webkit-tap-highlight-color: transparent;
}

.mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.mode-toggle-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.mode-toggle-btn.active .toggle-indicator {
    background: #000;
}

.toggle-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
    transition: all 0.2s ease;
}

.toggle-label {
    flex: 1;
    text-align: center;
}

/* Selection mode active state - red accent */
#selectionToggleBtn.active {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

#selectionToggleBtn.active .toggle-indicator {
    background: #fff;
}

.selection-mode #brushToggleBtn.active {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

.selection-mode #brushToggleBtn.active .toggle-indicator {
    background: #fff;
}

/* Selection mode controls */
.brush-controls-row {
    display: flex;
    gap: 10px;
}

.brush-mode,
.selection-mode {
    flex: 1;
}

.selection-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.selection-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.selection-separator {
    width: 1px;
    height: 25px;
    background: #333;
    margin: 0 8px;
}

.arrow-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.arrow-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
}

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

.arrow-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Selection mode opacity slider */
.selection-mode .slider {
    accent-color: #ff4444;
}

.selection-mode .slider::-webkit-slider-thumb {
    background: #ff4444;
}

.selection-mode .slider::-moz-range-thumb {
    background: #ff4444;
}

.selection-mode .slider-label {
    color: #ff4444;
}

.selection-mode .slider-input {
    width: 50px !important;
    max-width: 50px !important;
}


/* ---------- END - SELECTION MODE ---------- */

.output-section {
    background: #111;
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-all;
    padding: 15px;
    color: #999;
}

/*---------- INI - BRUSH MODE ----------*/
.brush-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.brush-toggle {
    width: 40px;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.brush-toggle.active {
    background: #fff;
    border-color: #fff;
}

.brush-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: all 0.2s ease;
}

.brush-toggle.active::after {
    transform: translateX(18px);
    background: #000;
}

.brush-label {
    font-size: var(--btn-font-size-main);
    color: #999;
    text-transform: uppercase;
    margin-left: 0.5rem;
    letter-spacing: 0.05em;
}

.brush-opacity {
    margin-top: px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.brush-opacity .slider-group {
    margin-bottom: 0px;
}

.opacity-preview {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 1px solid #333;
    border-radius: 2px;
    margin-left: 0px;
}

.eyedropper-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    border: 1px solid #333;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0px;
}

.eyedropper-btn:hover {
    background: #222;
    border-color: #555;
}

.eyedropper-btn.active {
    background: #fff;
    border-color: #fff;
}

.eyedropper-btn.active .btn-icon {
    stroke: #000;
}

.eyedropper-btn .btn-icon {
    width: 12px;
    height: 12px;
    stroke: #fff;
    transition: stroke 0.2s ease;
}

.grid-container.eyedropper-active .pixel:not(.inactive) {
    cursor: crosshair;
}

.opacity-hover-preview {
    position: absolute;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid #333;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .brush-mode {
        margin-top: 5px;
        margin-bottom: 15px;
    }

    div.selection-mode {
        margin-top: 5px;
        margin-bottom: 15px;
    }

    .brush-opacity {
        padding-top: 15px;
    }
    
    .eyedropper-btn {
        width: 22px;
        height: 22px;
    }
    
    .eyedropper-btn .btn-icon {
        width: 12px;
        height: 12px;
    }
}
/*---------- END - BRUSH MODE ----------*/

/* Action rows layout */
.action-row {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    grid-template-columns: 1fr 1fr 1fr;
}

.action-row.single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.action-row.single .btn {
    width: 100%;
    min-width: 0;
    flex: none;
}

.action-row.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.action-row.two .btn {
    width: 100%;
    min-width: 0;
    flex: none;
}

/* Remove bottom margin from last action-row in import section */
.action-row.last {
    margin-bottom: 0;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .action-row {
        grid-template-columns:  1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 15px 15px 40px 15px;
    }
    
    .main-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        width: 100%;
    }

    .grid-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .grid-container {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        max-width: 100%;
        overflow: visible;
    }

    .pixel {
        width: 18px;
        height: 18px;
    }

    .controls {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px 10px 30px 10px;
    }
    
    .main-content {
        gap: 25px;
        padding: 0;
    }

    .grid-section {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .grid-container {
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 100%;
        padding: 15px;
        overflow: visible;
    }

    .grid {
        gap: 0.2rem;
    }

    .pixel {
        width: 15px;
        height: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .controls {
        width: 100%;
        max-width: 100%;
        padding: 0 5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px 5px 28px 5px;
    }
    
    .grid-container {
        padding: 8px;
        margin: 0 auto;
        max-width: 100%;
        overflow: visible;
    }

    .grid {
        gap: 0.15rem;
    }

    .pixel {
        width: 12px;
        height: 12px;
    }

    .header {
        padding: 0 5px 10px 5px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header .main-title {
        font-size: 1.6rem;
        line-height: 1.4rem;
    }

    .controls {
        padding: 0;
    }

    .control-content {
        padding: 12px;
    }
}

@media (max-width: 390px) {
    .container {
        padding: 5px 5px 18px 5px;
    }
    
    .grid-container {
        padding: 5px;
        margin: 0 auto;
        max-width: 100%;
        overflow: visible;
    }

    .grid {
        gap: 0.1rem;
    }

    .pixel {
        width: 10px;
        height: 10px;
    }

    .header {
        padding: 0 3px 8px 3px;
        margin-bottom: 12px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .header .main-title {
        font-size: 1.4rem;
        line-height: 1.2rem;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 2px 2px 18px 2px;
    }
    
    .grid-container {
        padding: 3px;
        margin: 0 auto;
        max-width: 100%;
        overflow: visible;
    }

    .grid {
        gap: 0.08rem;
    }

    .pixel {
        width: 8px;
        height: 8px;
    }

    .header {
        padding: 0 2px 6px 2px;
        margin-bottom: 8px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .header .main-title {
        font-size: 1.2rem;
        line-height: 1rem;
    }
}


/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    display: none;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Image upload styles */
.import-controls {
    margin-top: 15px;
}

/*---------- INI - SLIDERS ----------*/
.slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.slider-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
}

.slider {
    flex: 1;
    height: 2px;
    background: #333;
    border-radius: 1px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.slider-input {
    width: 50px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    border-radius: 0;
    outline: none;
}

.slider-input:focus {
    border-color: #fff;
}

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

.slider-input[type=number] {
    -moz-appearance: textfield;
}
/*---------- END - SLIDERS ----------*/

.import-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
}

.mode-select {
    flex: 1;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    border-radius: 0;
    outline: none;
}

.mode-select:focus {
    border-color: #fff;
}

/* Modal styles */
.text-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #111;
    border: 1px solid #333;
    width: 90%;
    max-width: 400px;
    border-radius: 0;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group.nomargin {
    margin-bottom: 0px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.input-group:not(.top-group) label {
    margin-top: 15px;
    margin-bottom: 8px;
}

.input-group input[type="text"] {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #333;
    padding: 12px 15px;
    font-size: 0.85rem;
    font-family: 'Ndot-57', sans-serif;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-group input[type="text"]:focus {
    border-color: #fff;
}

.input-group .slider-group {
    margin-bottom: 0;
}

.checkbox-input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-radius: 4px;
    background: #000;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
}

.checkbox-input:checked {
    background: #fff;
    border-color: #fff;
}

.checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

/* ---------- INI - EMOJIS ----------*/
.emoji-modal-content {
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.emoji-modal-content .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.emoji-categories {
    display: flex;
    gap: 2px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.emoji-categories::-webkit-scrollbar {
    display: none;
}

.emoji-categories-container {
    position: relative;
}

.emoji-categories-container::after {
    content: '→';
    position: absolute;
    right: 5px;
    top: 0%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0.7;
    animation: scrollHint 2s ease-in-out infinite;
}

@keyframes scrollHint {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

.category-btn {
    font-family: "Noto Emoji", sans-serif;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    text-align: center;
    min-width: 44px;
    white-space: nowrap;
}

.category-btn:hover {
    background: #222;
}

.category-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.emoji-selector {
    border: 1px solid #333;
    background: #111;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    min-height: 200px;
    max-height: 300px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
    background: #333;
    padding: 1px;
    padding-bottom: 25px;
    overflow-y: auto;
    max-height: 300px;
}

.emoji-option {
    font-family: "Noto Emoji", sans-serif;
    color: white;
    background: #111;
    border: none;
    padding: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    aspect-ratio: 1;
}

.emoji-option:hover {
    background: #222;
}

.emoji-option.selected {
    background: #fff;
    color: #000;
}

.selected-emoji {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #000;
    border-top: 1px solid #333;
}

.selected-emoji-display {
    font-family: "Noto Emoji", sans-serif;
    font-size: 1.5rem;
    background: #111;
    border: 1px solid #333;
    padding: 8px 12px;
    border-radius: 0;
    min-width: 45px;
    max-width: 55px;
    min-height: 45px;
    max-height: 45px;
    text-align: center;
}

.selected-emoji-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Scrollbar for emoji grid */
.emoji-grid::-webkit-scrollbar {    
    width: 8px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: #000;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.emoji-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid #333;
}

.emoji-mode {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emoji-toggle {
    width: 40px;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-toggle.active {
    background: #fff;
    border-color: #fff;
}

.emoji-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: all 0.2s ease;
}
.emoji-toggle.active::after {
    transform: translateX(18px);
    background: #000;
}

.emoji-label {
    font-size: var(--btn-font-size-main);
    color: #999;
    text-transform: uppercase;
    margin-left: 0.5rem;
    letter-spacing: 0.05em;
}

.selected-emoji-display,
.emoji-option,
.category-btn {
    transition: font-family 0.2s ease;
}
/* ---------- END - EMOJIS ----------*/

/* Binary input styles */
#binaryInput {
    width: 100%;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 12px 15px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 80px;
}

#binaryInput:focus {
    border-color: #fff;
}

/* Disabled button styles */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: transparent;
    color: #fff;
    border-color: #333;
}
/* History controls at the top */
.history-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 0 20px;
}

/* Export Button Section */
.export-button-section {
    border: 1px solid #333;
    background: #000;
    width: 100%;
}

.export-button-section .btn {
    width: 100%;
    margin-bottom: 0;
    padding: 15px 20px;
    border: none;
    background: #111;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0;
}

.export-button-section .btn:hover {
    background: #fff;
    color: #000;
}

/* Binary input styles */
.binary-import-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

#binaryInput {
    width: 100%;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 12px 15px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 15px;
}

#binaryInput:focus {
    border-color: #fff;
}

/* Disabled button styles */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: transparent;
    color: #fff;
    border-color: #333;
}

@media (max-width: 768px) {
    
    .history-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: var(--btn-font-size-reduced);
    }

    .emoji-categories {
        position: relative;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .emoji-categories::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 8px;
        pointer-events: none;
        z-index: 1;
    }
    
    .emoji-categories::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 8px;
        pointer-events: none;
        z-index: 1;
    }

    .emoji-categories-container::after {
        display: block;
    }
}

@media (min-width: 769px) {
    .emoji-categories-container::after {
        display: none;
    }
}


/*---------- INI - FEEDBACK ----------*/
.unified-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #111;
    border: 1px solid #333;
    padding: 15px 20px;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    word-wrap: break-word;
}

.unified-feedback.show {
    opacity: 1;
    transform: translateX(0);
}

.unified-feedback.success {
    color: #fff;
    border-color: #ffffff;
    background: #111;
}

.unified-feedback.error {
    color: #fff;
    border-color: #f44336;
    background: #111;
}

/* Multiple feedback stacking */
.unified-feedback:nth-of-type(2) {
    top: 80px;
}

.unified-feedback:nth-of-type(3) {
    top: 140px;
}

.unified-feedback:nth-of-type(4) {
    top: 200px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .unified-feedback {
        top: 15px;
        right: 15px;
        left: 15px;
        right: 15px;
        max-width: none;
        text-align: center;
        transform: translateY(-100%);
    }
    
    .unified-feedback.show {
        transform: translateY(0);
    }
    
    .unified-feedback:nth-of-type(2) {
        top: 75px;
    }
    
    .unified-feedback:nth-of-type(3) {
        top: 135px;
    }
    
    .unified-feedback:nth-of-type(4) {
        top: 195px;
    }
}

@media (max-width: 480px) {
    .unified-feedback {
        font-size: 0.7rem;
        padding: 12px 15px;
    }
}
/*---------- END - FEEDBACK ----------*/


/*---------- INI - ANIMATION ----------*/
/* Animation Section Wrapper */
.animation-section {
    width: 100%;
    max-width: 1225px;
    margin: 0 auto 40px auto;
}

/* Animation Controls */
.animation-controls {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.animation-controls .btn {
    margin-bottom: 0;
    padding: 10px 16px;
    font-size: 0.75rem;
}

/* Frames Timeline */
.frames-timeline {
    margin-bottom: 20px;
}

.frames-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid #333;
    background: #111;
    scroll-behavior: smooth;
    justify-content: flex-start;
    align-items: center;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-color: #666 #111;
}

.frames-container::-webkit-scrollbar {
    height: 8px;
}

.frames-container::-webkit-scrollbar-track {
    background: #111;
}

.frames-container::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.frames-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.frame-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border: 2px solid #333;
    background: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-preview:hover {
    border-color: #666;
}

.frame-preview.active {
    border-color: #fff;
    background: #111;
}

.frame-preview.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    z-index: 1000;
}

.frame-preview.drag-over {
    border-color: #f44336;
    background: #1a2a3a;
}

.frame-mini-grid {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    gap: 0px;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.frame-mini-pixel {
    width: 2px;
    height: 2px;
    background: black;
    border-radius: 20%;
    pointer-events: none;
}

.frame-mini-pixel.active {
    background: #fff;
}

.frame-mini-pixel.inactive {
    background: #363636c5;
}

.frame-number {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: #999;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 3px;
    border-radius: 2px;
    pointer-events: none;
}

.frame-duration-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #fff;
    transition: width 0.2s ease;
    pointer-events: none;
}

/* Duration Control */
.duration-control {
    margin-top: 15px;
    text-align: center;
}

.duration-control .slider-group {
    padding: 0px;
    margin: 0 auto;
    width: 80%;
}

.duration-control .slider {
    flex: 1;
}

.duration-unit {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 25px;
}

/* Responsive */
@media (max-width: 768px) {
    .animation-controls {
        gap: 8px;
    }
    
    .animation-controls .btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.7rem;
    }
    
    .duration-control {
        text-align: left;
    }
    
    .duration-control .slider-group {
        width: 100%;
        margin: 0px;
    }
    
    .frames-container {
        gap: 8px;
        padding: 4px;
    }
    
    .frame-preview {
        width: 70px;
        height: 70px;
    }
    
    .frame-mini-grid {
        width: 60px;
        height: 60px;
    }
    
}

@media (max-width: 480px) {
    .animation-controls {
        gap: 6px;
    }
    
    .animation-controls .btn {
        padding: 8px 10px;
        font-size: 0.7rem;
    }
    
    .frame-preview {
        width: 70px;
        height: 70px;
    }
    
    .frame-mini-grid {
        width: 60px;
        height: 60px;
    }
    
}
/*---------- END - ANIMATION ----------*/


/*---------- INI - GIF IMPORT ----------*/
.jsgif {
    display: none;
}

.gif-preview {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #111;
    text-align: center;
}

@media (max-width: 768px) {
    .gif-preview {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    #gifModal .modal-content {
        width: 90%;
        max-width: 350px;
        margin: 10px auto;
        max-height: 80vh;
        overflow-y: auto;
        position: relative;
    }
    
    #gifModal .modal-body {
        padding: 15px;
    }
    
    #gifModal .input-group {
        margin-bottom: 10px;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    #gifModal .input-group label {
        min-width: 70px;
        flex-shrink: 0;
        font-size: 0.9rem;
        display: inline-block;
        margin-bottom: 0;
        margin-top: 0;
    }
    
    #gifModal .input-group .slider {
        flex: 1;
        min-width: 120px;
    }
    
    #gifModal .input-group .slider-input {
        width: 50px;
        min-width: 50px;
    }
    
    #gifModal .slider-group {
        margin-bottom: 10px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    #gifModal .modal-content {
        width: 85%;
        max-width: 320px;
        margin: 5px auto;
        max-height: 75vh;
        box-sizing: border-box;
        position: relative;
    }
    
    #gifModal .modal-body {
        padding: 10px;
        box-sizing: border-box;
    }
    
    #gifModal .input-group {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    #gifModal .input-group label {
        min-width: 60px;
        flex-shrink: 0;
        font-size: 0.8rem;
        display: inline-block;
        margin-bottom: 0;
        margin-top: 0;
    }
    
    #gifModal .input-group .slider {
        flex: 1;
        min-width: 140px;
    }
    
    #gifModal .input-group .slider-input {
        width: 40px;
        min-width: 40px;
        font-size: 0.8rem;
    }
    
    #gifModal .modal-header h3 {
        font-size: 1rem;
    }
    
    #gifModal .slider-input {
        width: 35px;
        min-width: 35px;
        font-size: 0.8rem;
        padding: 2px 1px;
    }
    
    #gifModal .slider {
        flex: 1;
        min-width: 160px;
        width: auto;
    }
    
    #gifModal .slider-group {
        display: flex;
        align-items: center;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px;
    }
    
    #gifModal .slider-label {
        min-width: 50px;
        flex-shrink: 0;
        font-size: 0.8rem;
    }
    
    .gif-progress {
        margin-top: 8px;
    }
    
    #gifModal.text-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }
}

.gif-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #999;
}

.gif-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #f44336;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #999;
    display: block;
    text-align: center;
}

/* GIF Modal Desktop Layout */
@media (min-width: 769px) {
    #gifModal .input-group {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
    }

    #gifModal .input-group label {
        min-width: 80px;
        flex-shrink: 0;
        display: inline-block;
        margin-bottom: 0;
        margin-top: 0;
    }

    #gifModal .input-group .slider {
        flex: 1;
        min-width: 150px;
    }

    #gifModal .input-group .slider-input {
        width: 60px;
        min-width: 60px;
    }
}
/*---------- END - GIF IMPORT ----------*/


/*---------- INI - DANGER MODAL ----------*/
.danger-icon {
    color: #f44336;
    margin-right: 8px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.danger-text {
    color: #f44336;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.danger-subtext {
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 20px;
}

.danger-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.danger-buttons .btn {
    width: 120px;
    padding: 10px 15px;
    text-align: center;
    box-sizing: border-box;
}

.danger-buttons .btn.danger {
    background: #f44336;
    border-color: #f44336;
}

.danger-buttons .btn.danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}
/*---------- END - DANGER MODAL ----------*/


/*---------- INI - EXPORT MODAL ----------*/
#exportModal {
    align-items: center;
    justify-content: center;
}

.export-modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.export-settings {
    margin: 0 auto 20px auto;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.export-settings.nomargin {
    margin: 0 auto 0px auto;
}

.export-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Export Tabs */
.export-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    background: #000;
    position: sticky;
    top: 0;
    z-index: 10;
}

.export-tab {
    flex: 1;
    background: #111;
    border: none;
    color: #999;
    padding: 15px 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-right: 1px solid #333;
}

.export-tab:last-child {
    border-right: none;
}

.export-tab:hover {
    background: #222;
    color: #fff;
}

.export-tab.active {
    background: #fff;
    color: #000;
}

.tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Tab Content */
.export-tab-content {
    display: none;
    padding: 20px;
}

.export-tab-content.active {
    display: block;
}

/* Other tabs padding */
.export-tab-padding {
    padding: 0;
}

/* Image tab specific sticky layout */
#imageTab {
    position: relative;
    padding: 0;
}

#imageTab.active {
    height: auto;
    max-height: 700px;
    display: flex;
    flex-direction: column;
}

.image-tab-scrollable {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px;
}

/* Animation tab specific sticky layout */
#animationTab {
    position: relative;
    padding: 0;
}

#animationTab.active {
    height: auto;
    max-height: 700px;
    display: flex;
    flex-direction: column;
}

.animation-tab-scrollable {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px;
}

/* Data tab specific sticky layout */
#dataTab {
    position: relative;
    padding: 0;
}

#dataTab.active {
    height: auto;
    max-height: 700px;
    display: flex;
    flex-direction: column;
}

.data-tab-scrollable {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px;
}

.image-tab-sticky-footer {
    position: sticky;
    bottom: 0;
    background: #111;
    border-top: 1px solid #333;
    padding: 15px 20px;
    z-index: 10;
    margin-top: auto;
}

.image-tab-sticky-footer .export-download-btn {
    margin-bottom: 0;
}

/* Export Preview */
.export-preview {
    background: #111;
    border: 1px solid #333;
    padding: 10px;
    padding-top: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
}

.preview-play-pause-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.preview-play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.preview-btn-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

#exportPreviewCanvas {
    width: 200px;
    height: 200px;
    border: 1px solid #333;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
}

.preview-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0px;
    font-size: 0.75rem;
    color: #666;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 340px;
}

.setting-group:last-child {
    margin-bottom: 0px;
}

.setting-group label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 120px;
    margin: 0;
    flex-shrink: 0;
    text-align: left;
}

.export-select {
    width: 200px;
    height: 40px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    border-radius: 0;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}

.export-select:focus {
    border-color: #fff;
}

.export-slider {
    flex: 1;
    height: 2px;
    background: #333;
    border-radius: 1px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 140px;
}

.export-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.export-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.export-input {
    width: 60px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    border-radius: 0;
    outline: none;
}

.export-input:focus {
    border-color: #fff;
}

.unit {
    font-size: 0.7rem;
    color: #666;
    min-width: 20px;
    margin-left: 0px;
}

/* Color input styling */
input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid #333;
    background: #111;
    cursor: pointer;
    border-radius: 0;
    outline: none;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
}

input[type="color"]:focus {
    border-color: #fff;
}

/* Container for slider + input combos */
.setting-group .export-slider + .export-input {
    margin-left: 8px;
}

/* Nested slider-group within setting-group */
.setting-group .slider-group {
    margin-bottom: 0;
    width: 100%;
    flex: 1;
}

.setting-group .slider-label {
    min-width: 80px;
    font-size: 0.75rem;
}

/* Remove spinner arrows from number inputs */
.export-input::-webkit-outer-spin-button,
.export-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* Make slider controls fill available space like other setting-group content */
.setting-group .export-slider {
    flex: 1;
}

/* Input with unit styling */
.input-with-unit {
    position: relative;
    display: inline-block;
}

.input-with-unit .export-input {
    padding-right: 20px;
}

.input-unit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #666;
    pointer-events: none;
}

/* Background setting with integrated color picker */
.setting-group:has(#imageBg) {
    gap: 0;
}

.setting-group:has(#imageBg) label {
    margin-right: 12px;
}

.setting-group:has(#imageBg) .export-select {
    width: 160px;
    border-right: none;
}

.setting-group:has(#imageBg) #customBgColor {
    border-left: none;
    margin-left: 0;
}

/* Export Buttons */
.export-download-btn {
    width: 100%;
    margin-bottom: 0;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-buttons .btn {
    flex: 1;
    margin-bottom: 0;
}

#dataOutput {
    width: 100%;
    height: 200px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 12px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    border-radius: 0;
    outline: none;
    resize: vertical;
    line-height: 1.4;
}

#dataOutput:focus {
    border-color: #fff;
}

/* Share Options */
.share-options {
    padding: 0;
}

.share-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.share-preset label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
    margin: 0;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    margin-bottom: 0;
    padding: 12px 16px;
    font-size: 0.75rem;
}

.twitter-btn:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: #fff;
}

.facebook-btn:hover {
    background: #4267b2;
    border-color: #4267b2;
    color: #fff;
}

.share-info {
    background: #111;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 4px;
}

.share-info p {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .export-modal-content {
        max-width: 95%;
        margin: 10px auto;
        max-height: 85vh;
    }
    
    #imageTab.active {
        height: auto;
        max-height: 85vh;
    }

    .export-tab {
        padding: 12px 8px;
        font-size: 0.7rem;
        flex-direction: column;
        gap: 4px;
    }

    .tab-icon {
        width: 14px;
        height: 14px;
    }

    .export-tab-content {
        padding: 15px;
    }
    
    .image-tab-scrollable {
        padding: 15px;
        padding-bottom: 15px;
    }
    
    .image-tab-sticky-footer {
        padding: 12px 15px;
    }

    .export-settings {
        max-width: 320px;
    }

    .setting-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        max-width: 300px;
    }

    .setting-group label {
        width: 80px;
        font-size: 0.7rem;
        margin-bottom: 0;
    }
    
    .export-select {
        width: 200px;
        height: 36px;
        padding: 6px 10px;
    }
    
    .export-slider {
        min-width: 120px;
    }
    
    .export-input {
        width: 50px;
    }
    
    input[type="color"] {
        width: 36px;
        height: 36px;
    }

    .setting-group:has(#imageBg) .export-select {
        width: 164px;
    }

    .share-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .export-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .preview-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .export-modal-content {
        max-width: 90%;
        max-height: 80vh;
    }
    
    #imageTab.active {
        height: auto;
        max-height: 80vh;
    }

    .export-tab {
        padding: 10px 6px;
        font-size: 0.65rem;
    }

    .tab-icon {
        width: 12px;
        height: 12px;
    }

    .export-tab-content {
        padding: 12px;
    }
    
    .image-tab-scrollable {
        padding: 12px;
        padding-bottom: 12px;
    }
    
    .image-tab-sticky-footer {
        padding: 10px 12px;
    }
}
/*---------- END - EXPORT MODAL ----------*/

/*---------- ADVANCED IMPORT MODAL ----------*/
.advanced-import-modal-content {
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.advanced-import-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.import-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    background: #1a1a1a;
    flex-shrink: 0;
}

.import-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #999;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.import-tab:hover {
    background: #222;
    color: #fff;
}

.import-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    background: #111;
}

.import-tab .tab-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.import-tab-content {
    display: none;
    padding: 20px;
}

.import-tab-content.active {
    display: block;
}

.advanced-preview-section {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #333;
    background: #0a0a0a;
}

.preview-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 12px auto;
    border: 1px solid #333;
    background: #000;
    border-radius: 4px;
}

#advancedPreviewCanvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border-radius: 3px;
}

.matrix-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 3px;
    overflow: hidden;
}

.overlay-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(25, 1fr);
    gap: 1px;
}

.overlay-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1px;
}

.overlay-pixel {
    width: 8px;
    height: 8px;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 1px;
    box-sizing: border-box;
}

#advancedPreviewInfo {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

.upload-area, .paste-area, .url-area {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area {
    border: 2px dashed #333;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.upload-area:hover {
    border-color: #4CAF50;
}

.upload-area.dragover {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.upload-content, .paste-content {
    text-align: center;
}

.upload-icon, .paste-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px auto;
    color: #666;
    stroke-width: 1.5;
}

.upload-content p, .paste-content p {
    margin: 0 0 16px 0;
    color: #999;
    font-size: 0.9rem;
}

.url-area {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.advanced-controls {
    padding: 20px;
    border-top: 1px solid #333;
    background: #0f0f0f;
}

.advanced-controls h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.control-grid:last-child {
    margin-bottom: 0;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-label {
    color: #ccc;
    font-size: 0.9rem;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 72px;
}

.position-btn {
    width: 20px;
    height: 20px;
    background: #222;
    border: 1px solid #444;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.position-btn:hover {
    background: #333;
    color: #fff;
}

.position-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.advanced-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #333;
    background: #111;
    flex-shrink: 0;
}

.advanced-modal-actions .btn {
    flex: 1;
}

/* Responsive Design for Advanced Modal */
@media (max-width: 768px) {
    .advanced-import-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .preview-container {
        width: 200px;
        height: 200px;
    }
    
    .import-tab {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    
    .import-tab .tab-icon {
        width: 14px;
        height: 14px;
    }
    
    .control-grid {
        gap: 12px;
    }
    
    .advanced-controls {
        padding: 16px;
    }
    
    .import-tab-content {
        padding: 16px;
    }
    
    .advanced-preview-section {
        padding: 0 16px 16px 16px;
    }
    
    .advanced-modal-actions {
        padding: 16px;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .advanced-import-modal-content {
        max-height: 95vh;
    }
    
    .preview-container {
        width: 180px;
        height: 180px;
    }
    
    .import-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .import-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .import-tab {
        min-width: 80px;
        flex-shrink: 0;
        padding: 8px;
        font-size: 0.75rem;
    }
    
    .control-grid {
        gap: 10px;
    }
    
    .checkbox-group {
        justify-content: space-between;
    }
}
/*---------- END - ADVANCED IMPORT MODAL ----------*/

/*---------- INI - RESTORE SESSION MODAL ----------*/
.restore-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.restore-modal .modal-content {
    background: #111;
    border: 1px solid #333;
    width: 90%;
    max-width: 500px;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.restore-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #222;
}

.restore-modal .modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.restore-modal .modal-body {
    padding: 20px;
}

.restore-info {
    text-align: center;
    margin-bottom: 20px;
}

.restore-info p {
    color: #aaa;
    margin: 5px 0;
}

.restore-info .saved-date {
    font-size: 0.85rem;
    color: #777;
}

.restore-preview {
    width: 100%;
    height: 200px;
    background: #000;
    border: 1px solid #222;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.restore-preview canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
}

.restore-details {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #222;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 5px;
}

.detail-item span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.restore-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #222;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.restore-modal .btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    font-size: 0.9rem;
}

.restore-modal .btn.primary {
    background: #0077ff;
    color: #fff;
}

.restore-modal .btn.primary:hover {
    background: #0066dd;
}

.restore-modal .btn.secondary {
    background: transparent;
    color: #fff;
    border: 1px solid #444;
}

.restore-modal .btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
}

@media (max-width: 600px) {
    .restore-modal .modal-content {
        max-width: 95%;
    }
    
    .restore-preview {
        height: 150px;
    }
    
    .restore-modal .modal-footer {
        flex-direction: column;
    }
    
    .restore-modal .btn {
        max-width: 100%;
    }
}

/* Keyboard Shortcuts Modal */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.shortcuts-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
}

.shortcuts-content .modal-header h3 {
    display: flex;
    align-items: center;
}

.shortcuts-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.shortcut-group {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.shortcut-group h4 {
    margin: 0 0 15px 0;
    color: #999;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item span:first-child {
    flex: 1;
    color: #ccc;
    font-size: 0.9rem;
}

.shortcut-note {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

.shortcut-keys {
    background: #222;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    border: 1px solid #333;
}

@media (max-width: 600px) {
    .shortcuts-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .shortcuts-body {
        padding: 15px;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .shortcut-keys {
        align-self: flex-end;
    }
}
/*---------- END - RESTORE SESSION MODAL ----------*/