/* Reset básico para mobile */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --memoryarn-primary: #ec4899;
    --memoryarn-secondary: #a855f7;
    --memoryarn-accent: #be185d;
    --memoryarn-light: #fdf2f8;
}

.gradient-bg {
    background: linear-gradient(
        to right,
        var(--memoryarn-primary),
        var(--memoryarn-secondary)
    );
}

/* Layout principal */
.mobile-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    user-select: none;
    background-color: #18181b;
}

/* Barra superior */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 3rem;
    min-height: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Área principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Editor e Preview */
.editor-section {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-section {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Container do preview */
.preview-container {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff7ed;
}

/* Painel de controle */
.control-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(24, 24, 27, 0.95);
}

/* Componentes */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Barra de categorias */
.category-bar {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem 0.75rem;
    background: rgba(39, 39, 42, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Esconde scrollbars */
.scroll-hidden {
    scrollbar-width: none;
}

.scroll-hidden::-webkit-scrollbar {
    display: none;
}

/* Media queries para desktop */
@media (min-width: 48rem) {
    .main-content {
        flex-direction: row;
    }

    .editor-section {
        width: 40%;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: none;
    }

    .preview-section {
        width: 60%;
    }
}

.color-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 0.75rem;
    border-radius: 0.375rem;
    background: var(--slider-bg);
    outline: none;
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: var(--thumb-color);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hue-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 0.75rem;
    border-radius: 0.375rem;
    background: linear-gradient(
        to right,
        #ff0000,
        #ffff00,
        #00ff00,
        #00ffff,
        #0000ff,
        #ff00ff,
        #ff0000
    );
    outline: none;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: var(--thumb-color);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.compact-picker {
    max-height: 8.75rem;
    transition: all 0.3s ease;
}

.history-item {
    min-width: 0.875rem;
    min-height: 0.875rem;
    transition: all 0.2s;
}

.history-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px white, 0 0 0 3px var(--item-color);
}

.tab-button {
    transition: all 0.2s;
    color: #18181b
}

.tab-button.active {
    background-color: #24243555;
    font-weight: 500;
}

.gradient-text {
    background: linear-gradient(45deg, #ec4899, #ec4848);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.glass-panel {
    background: rgba(39, 39, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-gradient {
    background: linear-gradient(45deg, #ec4899, #ec4848);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tab-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}

.tab-content::-webkit-scrollbar {
    width: 0.375rem;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
}

.tab-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 0.25rem;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.8);
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#previewArea {
    background: #fff7ed;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.component-card {
    background: rgba(39, 39, 42, 0.5);
    transition: all 0.3s ease;
}

.component-card:hover {
    transform: translateY(-0.1875rem);
    background: rgba(63, 63, 70, 0.4);
}

/* CSS */
#memoryarn-assistant {
    position: fixed;
    bottom: 1.875rem;
    right: 1.875rem;
    z-index: 10000;
    font-family: Arial, sans-serif;
}

.assistant-avatar {
    width: 4.375rem;
    height: 4.375rem;
    cursor: pointer;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.875rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

.assistant-chat {
    position: absolute;
    bottom: 5.3125rem;
    right: 0;
    width: 18.75rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    padding: 1.2rem;
    display: none;
    max-height: 70vh;
    overflow-y: auto;
}

.chat-visible {
    display: block;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assistant-message {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.4;
    animation: slideIn 0.3s ease-out;
}

.assistant-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.assistant-button {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    background: #ff6b6b;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
}

.assistant-button:hover {
    opacity: 0.9;
}

.tip-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    animation: pulse 2s infinite;
}

.spotlight {
    position: fixed;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    transition: all 0.3s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

#preview-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}

#preview-content::-webkit-scrollbar {
    width: 0.375rem;
}

#preview-content::-webkit-scrollbar-track {
    background: transparent;
}

#preview-content::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.5);
    border-radius: 0.1875rwm;
}

.btn-gradient {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.9) 0%,
        rgba(124, 58, 237, 0.9) 100%
    );
}

.btn-gradient:hover {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 1) 0%,
        rgba(124, 58, 237, 1) 100%
    );
}

.gradient-text {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out forwards;
}

@keyframes slide-up {
    from {
        transform: translateY(1.25rem);
        opacity: 0;
    }

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

.glass-panel {
    background: rgba(39, 39, 42, 0.5);
}

#dragIndicator {
    will-change: transform, opacity;
    transition: opacity 0.15s ease-out;
}

#indicatorCircle {
    will-change: transform, opacity, background-color;
    transition: all 0.15s ease-out;
}

#dragIndicator svg path {
    transition: stroke 0.15s ease-out;
}
.ma-thumbnail-uploader {
    --ma-primary: #7c3aed;
    --ma-dark: #ffffff;
    --ma-darker: #f4f4f5;
    --ma-light: #09090b;
    --ma-border: #e4e4e7;
    --ma-error: #dc2626;
    --ma-info: #2563eb;
    font-family: "Inter", sans-serif;
}

.ma-upload-container {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
}

.ma-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 2px dashed var(--ma-border);
    border-radius: 0.75rem;
    background-color: var(--ma-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ma-upload-area:hover {
    border-color: var(--ma-primary);
    background-color: var(--ma-darker);
}

.ma-upload-area svg {
    width: 48px;
    height: 48px;
    color: var(--ma-primary);
}

.ma-upload-area p {
    margin: 0;
    color: var(--ma-light);
    font-size: 0.875rem;
    font-weight: 500;
}

.ma-upload-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 0.375rem;
    color: var(--ma-info);
    font-size: 0.75rem;
    max-width: 280px;
    margin-top: 0.5rem;
}

.ma-upload-note svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--ma-info);
}

#maFileInput {
    display: none;
}

.ma-preview-area {
    display: none;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--ma-border);
}

.ma-preview-header {
    padding: 0.5rem;
    background-color: var(--ma-darker);
    text-align: center;
    font-size: 0.75rem;
    color: var(--ma-light);
    border-bottom: 1px solid var(--ma-border);
}

#maImagePreview {
    display: block;
    max-width: 100%;
    max-height: 300px;
    margin: 0 auto;
    background-color: var(--ma-dark);
}

.ma-actions {
    padding: 0.75rem;
    background-color: var(--ma-darker);
    text-align: center;
    border-top: 1px solid var(--ma-border);
}

.ma-change-btn {
    background: none;
    border: 1px solid var(--ma-border);
    color: var(--ma-light);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ma-change-btn:hover {
    border-color: var(--ma-primary);
    color: var(--ma-primary);
}

.ma-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--ma-dark);
    font-size: 0.875rem;
}

.ma-spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--ma-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: maSpin 1s linear infinite;
}

@keyframes maSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.ma-error {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(220, 38, 38, 0.1);
    border-radius: 0.375rem;
    color: var(--ma-error);
    font-size: 0.75rem;
    text-align: center;
}

#submit-memory{
    border: 1px solid #9333ea;
}