/* RESET & FONTS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

/* VARIABLES CYBER-GLASS */
:root {
    --accent: #4f7df5;
    --bg: #0A0A0A;
    --text: #e5e7eb;
    --card: rgba(255, 255, 255, 0.02);
    --card-hover: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    --glass: rgba(10, 10, 10, 0.6);
    --radius: 18px;

    /* UX Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* PERFORMANCE MODE */
.perf-mode .cursor-dot,
.perf-mode .cursor-ring,
.perf-mode .depth-layer {
    display: none !important;
}

.perf-mode .bento-card {
    transform: none !important;
    transition: none !important;
}

body {
    background: var(--bg);
    color: var(--text);
    padding: 1.5rem;
    overflow-x: hidden;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    body {
        padding: 3rem;
    }
}

.container {
    max-width: 1080px;
    margin: 0 auto;
}

/* TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subtitle {
    color: #9ca3af;
    margin-top: 0.2rem;
    font-size: 0.95rem;
}

.text-accent {
    color: var(--accent);
}

/* CONTROL CENTER COMPACT */
.control-center {
    display: flex;
    gap: 0.8rem;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 12px;
    backdrop-filter: blur(16px);
}

.cc-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: .3s;
    display: flex;
    align-items: center;
    padding: 0 4px;
    justify-content: center;
}

.slider .icon-zap {
    font-size: 12px;
    color: #9ca3af;
    z-index: 10;
    transition: .3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #4b5563;
    border-radius: 50%;
    transition: .3s;
    z-index: 5;
}

input:checked+.slider {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

input:checked+.slider::before {
    transform: translateX(20px);
    background: #ef4444;
}

input:checked+.slider .icon-zap {
    color: white;
}

.accent-picker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.accent-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.accent-picker::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}

/* BENTO GRID */
.bento-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-card {
        grid-column: span 2;
    }

    .output-card {
        grid-column: span 3;
    }
}

/* CARDS CYBER-GLASS */
.bento-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: border-color .3s ease, background .3s ease;
}

.bento-card:hover {
    border-color: var(--border-highlight);
    background: var(--card-hover);
}

/* 3D DEPTH */
.depth-card {
    transform-style: preserve-3d;
}

.depth-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
}

.depth-glow {
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), var(--accent), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    mix-blend-mode: screen;
    filter: blur(40px);
}

.depth-card:hover .depth-glow {
    opacity: 0.15;
}

/* ICONS & LINKS */
.card-header {
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
}

.step {
    font-size: 0.85rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.2rem;
}

.link {
    color: var(--text);
    text-decoration: none;
    font-family: monospace;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    display: inline-block;
    transition: all .2s;
    border: 1px solid transparent;
}

.link.hover-glow:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    transform: translateX(5px);
}

/* FORMS */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #9ca3af;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.icon-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
}

form {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    form {
        grid-template-columns: 1fr 1fr;
    }

    .full-width {
        grid-column: span 2;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #9ca3af;
}

.counter-badge {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

input,
select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .3s, box-shadow .3s;
    width: 100%;
    min-width: 0;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

select option {
    background: #111;
}

.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    color: var(--success);
    font-weight: bold;
    font-size: 1.1rem;
}

.price-input-wrapper input {
    padding-left: 2.2rem;
    color: var(--success);
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
}

/* DYNAMIC ROWS & SMART SERIALS */
.dynamic-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
}

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 4.5rem minmax(0, 1.5fr) auto;
    gap: 0.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

@media (max-width: 640px) {
    .item-row {
        grid-template-columns: 1fr 1fr;
    }

    .item-row .row-arma {
        grid-column: span 2;
    }
}

.item-row input,
.item-row select {
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.serial-valid {
    border-color: var(--success) !important;
    box-shadow: inset 0 0 0 1px var(--success);
}

.serial-warning {
    border-color: var(--warning) !important;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .2s;
    font-size: 1.1rem;
}

.remove-btn:hover {
    background: var(--error);
    color: white;
}

.add-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-highlight);
    padding: 0.8rem;
    border-radius: 10px;
    color: #9ca3af;
    cursor: pointer;
    transition: .2s;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 0.2rem;
    font-weight: 500;
}

.add-btn:hover {
    border-color: var(--accent);
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* OUTPUT & TERMINAL */
.output-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 850px) {
    .output-card {
        flex-direction: row;
        align-items: stretch;
    }

    .output-content {
        flex: 1;
        min-width: 0;
    }

    .copy-btn {
        width: 180px;
    }
}

.status-dot {
    font-size: 0.75rem;
    border: 1px solid transparent;
    padding: 2px 8px;
    border-radius: 10px;
    transition: all 0.3s;
}

.status-dot.success {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.status-dot.error {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.terminal-style {
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    min-height: 140px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.terminal-style::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.5;
}

.format-pre {
    color: #e5e7eb;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
}

.placeholder-text {
    color: #4b5563;
    font-style: italic;
}

.copy-btn {
    background: var(--accent);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.copy-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.35);
}

.copy-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.btn-text-main {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-hotkey {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* SHAKE ERROR ANIMATION */
.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    border-color: var(--error) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* MODAL CYBER */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 1000;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Modal open animation: scale + fade */
.modal-backdrop .modal-card {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    transition: transform .28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity .22s ease;
}
.modal-backdrop.show .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-card {
    background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(6,8,11,0.95));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 1.25rem 1.25rem;
    width: 92%;
    max-width: 520px;
    text-align: left;
    transform: translateY(18px);
    transition: transform .28s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 18px 40px rgba(2,6,23,0.7);
}

.modal-backdrop.show .modal-card {
    transform: translateY(0);
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(79,125,245,0.12), rgba(79,125,245,0.06));
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    border: 1px solid rgba(79,125,245,0.08);
    font-size: 1.25rem;
}

.modal-card h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text);
}

.modal-card p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0.25rem 0 1rem 0;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-ghost {
        background: transparent;
        border: 1px solid rgba(255,255,255,0.06);
        padding: 0.6rem 0.9rem;
        border-radius: 8px;
        color: var(--text);
        cursor: pointer;
        transition: all .16s ease;
        font-weight: 600;
}

.btn-ghost:hover {
        background: rgba(255,255,255,0.02);
}

.btn-primary {
        background: linear-gradient(90deg, var(--accent), #2b6ef6);
        border: none;
        padding: 0.65rem 1rem;
        border-radius: 8px;
        color: white;
        cursor: pointer;
        font-weight: 700;
        transition: transform .14s ease, box-shadow .18s ease;
}

.btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(43,110,246,0.12);
}

/* Modal header layout for improved UI */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-title {
    display: flex;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* Inputs inside modal */
.modal-card input[type="text"], .modal-card input[type="url"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.modal-card label { color: #cbd5e1; font-weight: 600; margin-bottom: 0.35rem; display:block; }

.custom-channel-list li { padding: 0.35rem 0; }


/* CURSOR & TOAST */
* {
    cursor: none !important;
}

.perf-mode,
.perf-mode * {
    cursor: auto !important;
}

.perf-mode button,
.perf-mode a,
.perf-mode .switch,
.perf-mode input,
.perf-mode select,
.perf-mode i {
    cursor: pointer !important;
}

.cursor-dot {
    width: 24px;
    height: 24px;
    background: var(--accent);
    box-shadow: 0 0 8px 1px var(--accent);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
}

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #111;
    border-left: 3px solid var(--accent);
    color: white;
    padding: 0.8rem 1.2rem;
    gap: 0.4rem;
}

.copy-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.35);
}

.copy-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.btn-text-main {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-hotkey {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* SHAKE ERROR ANIMATION */
.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    border-color: var(--error) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* MODAL CYBER */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 1000;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #111;
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: translateY(20px);
    transition: transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

.modal-backdrop.show .modal-card {
    transform: translateY(0);
}

.modal-icon {
    width: 50px;
    height: 50px;
    background: rgba(79, 125, 245, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 1px solid rgba(79, 125, 245, 0.3);
    font-size: 1.5rem;
}

.modal-card h3 {
    margin-bottom: 0.5rem;
}

.modal-card p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-ghost {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: .2s;
    font-weight: 500;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    flex: 1;
    background: var(--accent);
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}
@keyframes matrix-glitch {
  0% { text-shadow: 2px 0 #0f0, -2px 0 #003300; filter: blur(1px); }
  20% { text-shadow: -2px 0 #0f0, 2px 0 #003300; filter: blur(0px); }
  40% { text-shadow: 2px 0 #0f0, -2px 0 #003300; filter: blur(1px); }
  60% { text-shadow: -2px 0 #0f0, 2px 0 #003300; filter: blur(0px); }
  80% { text-shadow: 2px 0 #0f0, -2px 0 #003300; filter: blur(1px); }
  100% { text-shadow: none; filter: blur(0); }
}

.matrix-typing {
  animation: matrix-glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color: #0f0 !important;
}
.matrix-typing span {
  color: #0f0 !important;
}

@keyframes blink-caret {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}
.blinking-cursor {
  animation: blink-caret 1s step-end infinite;
  color: var(--accent);
  font-weight: bold;
  margin-left: 2px;
}

/* Terminal loader (from Uiverse.io by jeremyssocial) - integrated */
@keyframes blinkCursor {
    50% { border-right-color: transparent; }
}

@keyframes typeAndDelete {
    0%, 10% { width: 0; }
    45%, 55% { width: 6.2em; }
    90%, 100% { width: 0; }
}

.terminal-loader {
    border: 0.08em solid rgba(255,255,255,0.06);
    background-color: rgba(10,10,10,0.55);
    color: var(--accent);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    padding: 1.25em 0.9em;
    width: 14em;
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.terminal-loader .terminal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.6em;
    background-color: rgba(255,255,255,0.03);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 0 0.5em;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-loader .terminal-title {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6em;
}

.terminal-loader .terminal-controls { display: flex; gap: 0.4em; }
.terminal-loader .control { width: 0.6em; height: 0.6em; border-radius: 50%; background-color: #777; }
.terminal-loader .control.close { background-color: #e33; }
.terminal-loader .control.minimize { background-color: #ee0; }
.terminal-loader .control.maximize { background-color: #0b0; }

.terminal-loader .text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.18em solid var(--accent);
    animation: typeAndDelete 4s steps(11) infinite, blinkCursor 0.5s step-end infinite alternate;
    margin-top: 1.6em;
    color: var(--text);
}

/* Small helper to fit inside existing output area */
.terminal-preview-wrapper { display: flex; gap: 1rem; align-items: flex-start; }
.terminal-preview-wrapper .terminal-loader { width: 100%; max-width: 24rem; }

/* Fancy social buttons (Discord / YouTube / Behance) */
.social-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.fancy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem; /* ~p-5 */
    border-radius: 9999px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99,102,241,0.08);
    background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,0,0,0.4));
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 20px rgba(2,6,23,0.6);
    transition: transform 300ms ease-out, box-shadow 300ms ease-out, border-color 300ms ease-out;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.fancy-btn .shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform: translateX(-100%);
    transition: transform 700ms ease-out;
    pointer-events: none;
}

.fancy-btn:hover .shine { transform: translateX(100%); }

.fancy-btn:hover { transform: translateY(-6px) scale(1.08) rotate(-3deg); box-shadow: 0 20px 40px rgba(79,70,229,0.14); border-color: rgba(99,102,241,0.25); }
.fancy-btn:active { transform: scale(0.96) rotate(0); }

.fancy-btn svg, .fancy-btn i { width: 1.6rem; height: 1.6rem; font-size: 1.6rem; color: #7c3aed; display: block; line-height: 1; margin: 0; }

/* variants */
.fancy-btn--discord svg, .fancy-btn--discord i { color: white; position: relative; z-index: 10; }
.fancy-btn--youtube svg, .fancy-btn--youtube i { color: white; position: relative; z-index: 10; }
.fancy-btn--behance svg, .fancy-btn--behance i { color: white; position: relative; z-index: 10; }

/* Brand-specific backgrounds */
.fancy-btn--discord { background: linear-gradient(135deg, #404eed33, #5865f233); border-color: rgba(88,101,242,0.25); box-shadow: 0 14px 30px rgba(88,101,242,0.12); }
.fancy-btn--youtube { background: linear-gradient(135deg, #ff000033, #ff000033); border-color: rgba(255,0,0,0.18); box-shadow: 0 14px 30px rgba(255,0,0,0.12); }
.fancy-btn--behance { background: linear-gradient(135deg, #1769ff33, #1769ff22); border-color: rgba(23,105,255,0.18); box-shadow: 0 14px 30px rgba(23,105,255,0.10); }

/* ensure shine stays behind icon */
.fancy-btn .shine { z-index: 1; }

.fancy-btn--discord:hover { box-shadow: 0 24px 48px rgba(88,101,242,0.18); }
.fancy-btn--youtube:hover { box-shadow: 0 24px 48px rgba(255,0,0,0.18); }
.fancy-btn--behance:hover { box-shadow: 0 24px 48px rgba(23,105,255,0.14); }

/* Add Item button (replicates provided Tailwind-like behavior) */
.add-item-btn {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 9rem; /* ~w-36 */
    height: 2.5rem; /* ~h-10 */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(16,185,129,0.15);
    background: linear-gradient(180deg, rgba(16,185,129,0.15), rgba(16,185,129,0.12));
    transition: transform 300ms ease, background 300ms ease, border-color 300ms ease, width 300ms ease;
}
.add-item-btn:active { transform: scale(0.98); }

.add-item-text {
    color: #e6fffa; /* light */
    font-weight: 600;
    margin-left: 2rem; /* ~ml-8 */
    transform: translateX(0);
    transition: transform 300ms ease;
    z-index: 2;
}

.add-item-icon {
    position: absolute;
    right: 0;
    height: 100%;
    width: 2.5rem;
    background: rgba(16,185,129,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    transform: translateX(0);
    transition: transform 300ms ease, width 300ms ease;
    z-index: 1;
}

.add-item-btn:hover .add-item-text { transform: translateX(2.5rem); }
.add-item-btn:hover { width: 11.5rem; }
.add-item-btn:hover .add-item-icon { width: 100%; transform: translateX(0); }

.link-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 0.45rem;
}
.link-badge.app { background: linear-gradient(90deg,#16a34a,#059669); }
.link-badge.web { background: linear-gradient(90deg,#2563eb,#60a5fa); }

/* tooltip on hover */
.link-badge[title] { position: relative; cursor: default; }
.link-badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.75rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
    z-index: 9999;
}

/* Compact styles specific to the "Personalizza Link" modal */
#linkSettingsModal .modal-card {
    max-width: 760px;
    padding: 1.25rem 1.25rem;
    width: 94%;
    text-align: left;
}

#linkSettingsModal .modal-card h3 {
    margin: 0 0 0.6rem 0;
    font-size: 1.05rem;
    text-align: center;
}

#linkSettingsModal .form-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

#linkSettingsModal .form-row input { flex: 1; margin: 0; }

#linkSettingsModal .add-item-btn {
    padding: 0.3rem 0.5rem;
    height: 38px;
    width: 46px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#linkSettingsModal .add-item-text { display: none; }

#linkSettingsModal .add-item-icon { position: static; width: 18px; height: 18px; }

#linkSettingsModal .custom-channel-list li {
    display:flex;
    gap:0.6rem;
    align-items:center;
    justify-content:space-between;
    padding: 0.45rem 0;
}

#linkSettingsModal .custom-channel-list li .left {
    display:flex; gap:0.6rem; align-items:center; min-width:0;
}

#linkSettingsModal .custom-channel-list .link { font-size:0.95rem; }

#linkSettingsModal .link-badge { width:12px; height:12px; padding:0; border-radius:50%; margin-left:0.45rem; }

/* Small app-toggle button */
/* removed app-toggle styles (Apri in app feature removed) */

/* Green Add primary button (as in attachment) */
.add-green-btn {
    background: linear-gradient(180deg,#2fd06a,#10b981);
    color: white;
    border: none;
    padding: 8px 18px;
    height: 36px;
    min-width: 72px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(16,185,129,0.18);
    cursor: pointer;
}
.add-green-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(16,185,129,0.22); }

/* Loading dots in preview */
.loading-dots {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
    font-size: 1rem;
    color: var(--accent);
}
.loading-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.25;
    transform: translateY(0);
    animation: loadingDot 1s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.12s; }
.loading-dots span:nth-child(3) { animation-delay: 0.24s; }
@keyframes loadingDot {
    0% { opacity: 0.25; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-6px); }
    100% { opacity: 0.25; transform: translateY(0); }
}