body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    font-family: 'Roboto', sans-serif;
    color: #0d1b2a;
    overflow: auto;
}

.desktop {
    min-height: 100vh;
    padding: 10px; /* Reduzido para telas pequenas */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.2);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.5);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

h1 {
    font-size: clamp(0.6em, 3vw, 0.7em); /* Ajuste dinâmico */
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 180, 216, 0.7);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: clamp(0.7em, 2.5vw, 0.9em);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tool-categories {
    margin-top: 15px;
}

.category {
    margin-bottom: 20px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: transform 0.3s;
}

.category:hover {
    transform: translateY(-3px); /* Menos movimento em telas pequenas */
}

.category h2 {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #00b4d8;
    margin-bottom: 6px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* Menor em telas pequenas */
    gap: 10px;
}

.tool-icon {
    background: #fff;
    border: 1px solid #00b4d8;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
}

.tool-icon:hover {
    transform: scale(1.03); /* Menor escala em mobile */
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.5);
    background: linear-gradient(45deg, #e0f7fa, #fff);
}

.tool-icon:active {
    transform: scale(0.95);
}

.tool-icon span {
    font-weight: bold;
    color: #00b4d8;
    font-size: clamp(0.7em, 2.5vw, 0.9em);
    display: block;
    word-wrap: break-word;
}

.modal {
    position: absolute;
    background: #fff;
    border: 1px solid #00b4d8;
    border-radius: 8px;
    padding: 10px;
    width: clamp(250px, 90vw, 400px); /* Mais adaptável */
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.3);
    z-index: 1000;
    resize: both;
    min-width: 150px;
    min-height: 100px;
}

.modal-header {
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    color: #fff;
    padding: 6px;
    display: flex;
    justify-content: space-between;
    border-radius: 4px 4px 0 0;
    cursor: move;
}

.close-btn {
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(0.7em, 2.5vw, 0.9em);
}

.login-container {
    background: #fff;
    border: 1px solid #00b4d8;
    border-radius: 8px;
    padding: 5%;
    max-width: 90%;
    width: clamp(250px, 80vw, 400px);
    margin: 10vh auto;
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.3);
}

.login-container h1 {
    text-align: center;
    font-size: clamp(1.2em, 4vw, 2em);
    margin-bottom: 15px;
}

.login-container input {
    width: 100%;
    padding: clamp(6px, 2vw, 12px);
    margin: clamp(6px, 1.5vw, 12px) 0;
    border: 1px solid #00b4d8;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: clamp(0.9em, 3vw, 1.2em);
}

.login-container button {
    width: 100%;
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    border: none;
    padding: clamp(6px, 2vw, 12px);
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: clamp(0.9em, 3vw, 1.2em);
}

.login-container p {
    margin-top: 10px;
    text-align: center;
    font-size: clamp(0.8em, 2.5vw, 1em);
}

.login-container a {
    color: #00b4d8;
    text-decoration: none;
}

.error {
    color: #ff6b6b;
    text-align: center;
    font-size: clamp(0.7em, 2.5vw, 0.9em);
}

.pomodoro-container {
    text-align: center;
}

#timer {
    font-size: clamp(1.2em, 5vw, 1.8em);
    margin-bottom: 8px;
}

button {
    margin: 4px;
    padding: clamp(3px, 1.5vw, 8px);
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: clamp(0.7em, 2.5vw, 0.85em);
}

button:hover {
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.5);
}

.editor-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-stats {
    font-size: clamp(0.7em, 2vw, 0.85em);
    color: #666;
}

.editor-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

#editor.dark-mode {
    background: #333;
    color: #fff;
}

#save-status {
    font-size: clamp(0.7em, 2vw, 0.85em);
    color: #00b4d8;
}

.premium-content {
    padding: 8px;
    text-align: left;
    overflow-y: auto;
    max-height: 70vh; /* Reduzido para mobile */
    font-size: clamp(0.7em, 2.5vw, 0.9em);
}

.premium-content h2 {
    font-size: clamp(0.9em, 3vw, 1.1em);
    color: #00b4d8;
    margin: 6px 0;
    text-transform: uppercase;
}

.premium-content ul {
    padding-left: 12px;
}

.premium-content li {
    margin: 3px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #00b4d8;
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background: #e0f7fa;
}

/* Temas */
body.light {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    color: #0d1b2a;
}

body.dark {
    background: linear-gradient(135deg, #1a2a44, #2a4066);
    color: #e0f7fa;
}

body.dark .desktop, body.dark .category, body.dark .modal, body.dark .login-container {
    background: rgba(30, 40, 60, 0.9);
    color: #e0f7fa;
}

body.dark .tool-icon, body.dark .modal {
    background: #2a4066;
    border-color: #4ecdc4;
}

body.dark .tool-icon span, body.dark .premium-content li {
    color: #4ecdc4;
}

body.dark button {
    background: linear-gradient(45deg, #4ecdc4, #90e0ef);
}

/* Dashboard */
.dashboard {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px;
    margin: 15px 0;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.2);
}

body.dark .dashboard {
    background: rgba(30, 40, 60, 0.9);
}

.dashboard h2, .dashboard h3 {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #00b4d8;
    margin-bottom: 8px;
}

body.dark .dashboard h2, body.dark .dashboard h3 {
    color: #4ecdc4;
}

.stats p {
    font-size: clamp(0.7em, 2.5vw, 0.9em);
    margin: 4px 0;
}

/* Comunidade Simulada */
.community {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px;
    margin: 15px 0;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.2);
}

body.dark .community {
    background: rgba(30, 40, 60, 0.9);
}

.community h2 {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #00b4d8;
    margin-bottom: 8px;
}

body.dark .community h2 {
    color: #4ecdc4;
}

.community p {
    font-size: clamp(0.7em, 2.5vw, 0.9em);
    margin: 4px 0;
    font-style: italic;
}

/* Dicas Contextuais */
.tip {
    font-size: clamp(0.6em, 2vw, 0.85em);
    color: #666;
    background: #e0f7fa;
    padding: 4px;
    border-radius: 4px;
    margin: 4px 0;
}

body.dark .tip {
    color: #e0f7fa;
    background: #4ecdc4;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

#progress {
    height: 100%;
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    transition: width 0.5s ease;
}

/* Favorites */
.fav-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    font-size: clamp(0.8em, 2.5vw, 1em);
    color: #ccc;
    cursor: pointer;
    padding: 0;
}

.fav-btn:hover {
    color: #ffd700;
}

/* Heatmap */
.heatmap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-item {
    height: 8px;
    background: linear-gradient(45deg, #00b4d8, #90e0ef);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 4px;
    font-size: clamp(0.6em, 2vw, 0.8em);
    color: #fff;
}

.shortcuts-content {
    padding: 8px;
    text-align: left;
}

.shortcuts-content ul {
    padding-left: 10px;
}

.shortcuts-content li {
    margin: 4px 0;
    font-size: clamp(0.7em, 2.5vw, 0.9em);
}

.nickname-section {
    margin-bottom: 8px;
}

.blocked-content {
    padding: 8px;
    text-align: center;
}

.blocked-content select {
    margin-bottom: 8px;
}

.chat-alert {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #ff6b6b;
    animation: blink 1s infinite;
    cursor: pointer;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Media Queries para telas pequenas */
@media (max-width: 600px) {
    .desktop {
        padding: 5px;
    }

    header {
        padding: 6px 8px;
        flex-wrap: wrap; /* Permite quebra em telas muito pequenas */
    }

    .header-actions {
        gap: 5px;
    }

    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }

    .tool-icon {
        padding: 6px;
    }

    .modal {
        width: 90vw;
        padding: 8px;
        min-width: 120px;
        min-height: 80px;
    }

    .login-container {
        padding: 3%;
        margin: 5vh auto;
    }

    .category {
        margin-bottom: 15px;
        padding: 6px;
    }

    button {
        margin: 3px;
        padding: clamp(2px, 1vw, 6px);
    }
}

@media (max-width: 400px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .tool-icon span {
        font-size: clamp(0.6em, 2vw, 0.8em);
    }

    .modal {
        width: 95vw;
    }

    .login-container {
        width: 90vw;
    }
}