/* Estilos personalizados para Markly */
:root {
    --card-default-color: #f8f9fa;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --app-background: transparent; /* Cambiado a transparente */
}

/* Asegurar que el body y container sean transparentes */
body {
    background: transparent;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    background: transparent; /* Asegurar transparencia */
}

/* Los grupos deben tener fondo */
.group {
    background-color: var(--card-default-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
    padding: 0.8rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: move;
    break-inside: avoid;
}

.hidden {
    display: none !important;
}

.group:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.group.dragging {
    opacity: 0.5;
    border: 2px dashed white;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgb(255 255 255 / 20%);
}

.group-title {
    font-weight: 500;
    font-size: 0.8rem;
    flex-grow: 1;
    margin: 0;
    padding: 0.25rem;
    border: 1px dashed transparent;
}

.group-title.editable {
    border-color: rgba(0,0,0,0.2);
    background-color: rgba(255,255,255,0.5);
}

.group-content {
    min-height: 2rem;
    padding: 0.5rem;
}

.group-actions {
	display: flex;
	flex-flow: row;
    gap: 0.5rem;
}

.group-actions button {
	display: none;
	font-size: 0.6rem;
	padding: 0.4rem;
	margin-bottom: 0rem;
}

.group .group-header:hover .group-actions button{
	display: flex;
}

/* Estilos para marcadores */
.bookmark {
    display: flex;
    align-items: center;
    padding: 0rem 0.4rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.bookmark:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bookmark-favicon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.bookmark-content {
    flex-grow: 1;
    display: flex;
}

.bookmark-title {
    font-weight: 400;
    font-size: 0.8rem;
    margin: 0;
	margin-right: 0.5rem;
    color: inherit;
    text-decoration: none;
	min-width: -webkit-fill-available;
}

.bookmark-url {
	display: none;
    font-size: 0.8rem;
	font-weight: 400;
    color: #666;
    margin: 0;
}

.bookmark:hover .bookmark-url{
	display: none;
}

.bookmark-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.bookmark-actions button {
	visibility: hidden;
    padding: 0.25rem 0.4rem;
    font-size: 0.6rem;
    width: fit-content;
    margin-bottom: 0px;
	margin: 0.2rem 0.1rem;
}

.bookmark:hover .bookmark-actions button {
	visibility: visible;
}

.add-bookmark-btn {
    width: 100%;
	font-size: 0.7rem;
	font-weight: 400;
    padding: 0.4rem;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.0);
    border: 1px dashed #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Selectores de color mejorados */
.color-picker {
    display: none;
    gap: 0.25rem;
    margin: 0rem;
    margin-bottom: 0.5rem;
	padding: 0.5rem;
    flex-wrap: wrap;
	background-color: #ffffff1c;
    border-radius: 5px;
}

.color-picker h4 {
	font-size: 0.8rem;
	font-weight: normal;
	width: 100%;
	margin-bottom: 0.2rem;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
	margin-bottom: 0.5rem;
}

.color-option.selected {
    border-color: #000;
}

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

/* Preview de marcador */
.bookmark-preview {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.favicon-preview {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.favicon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Opciones de fondo */
.background-options {
    margin: 1rem 0;
}

.image-preview {
    margin-top: 0.5rem;
    max-width: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* CSS RESPONSIVE MEJORADO PARA GRUPOS */
.groups-container {
    display: grid;
    gap: 0rem 1rem;
    margin-top: 1rem;
    
    /* Por defecto: 1 columna para móviles muy pequeños */
    grid-template-columns: 1fr;
}

/* Móviles pequeños (hasta 374px) - 1 columna */
@media (max-width: 374px) {
    .groups-container {
        grid-template-columns: 1fr;
    }
}

/* Móviles medianos (375px - 424px) - 1 columna */
@media (min-width: 375px) and (max-width: 424px) {
    .groups-container {
        grid-template-columns: 1fr;
    }
}

/* Móviles grandes (425px - 649px) - 1 columna */
@media (min-width: 425px) and (max-width: 649px) {
    .groups-container {
        grid-template-columns: 1fr;
    }
}

/* Tabletas pequeñas (650px - 767px) - 2 columnas */
@media (min-width: 650px) and (max-width: 767px) {
    .groups-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tabletas (768px - 969px) - 2 columnas */
@media (min-width: 768px) and (max-width: 969px) {
    .groups-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop pequeño (970px - 1199px) - 2 columnas */
@media (min-width: 970px) and (max-width: 1199px) {
    .groups-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop medio (1200px - 1399px) - 2 columnas */
@media (min-width: 1200px) and (max-width: 1399px) {
    .groups-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop grande (1400px - 1599px) - 3 columnas */
@media (min-width: 1400px) and (max-width: 1599px) {
    .groups-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop extra grande (1600px+) - 3 columnas */
@media (min-width: 1600px) {
    .groups-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Pantallas muy grandes */
@media (min-width: 1920px) {
    .groups-container {
        grid-template-columns: repeat(5, 1fr);
    }
    .container {
        max-width: 90%;
    }
}

@media (min-width: 2440px) {
    .groups-container {
        grid-template-columns: repeat(5, 1fr);
    }
    .container {
        max-width: 90%;
    }
}

/* Resto de estilos se mantienen igual... */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0px;
    background-color: transparent;
    border-radius: var(--border-radius);
}

.toolbar h1 {
    width: 50%;
	display:flex;
	align-items: center;
    max-width: 50%;
    display: flex;
    margin-bottom: 0px;
}

.toolbar img{
	max-width: 2rem;
	margin-right: 0.5rem;
}

.user-info {
    width: 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.user-info button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    width: fit-content;
    margin-bottom: 0px;
}

.user-info #user-email{
    font-size: 0.8rem;
}

#logout-btn {
    font-size: 0.8rem;
    width: fit-content;
    display: block;
    white-space: nowrap;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.captcha-code {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #f0f0f0;
    padding: 0.5rem;
    border-radius: 4px;
    letter-spacing: 3px;
}

.notification {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background-color: #333;
    color: white;
    font-size: 0.8rem;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.warning {
    background-color: #ffc107;
    color: #000;
}

.login-container, .register-container, .reset-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.content-editor {
    margin-top: 1rem;
}

.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    width: fit-content;
    margin-bottom: 0px;
}

.sync-status {
    font-size: 0.7rem;
	font-weight: 400;
    color: whitesmoke;
    margin-top: 0.5rem;
}

.password-strength {
    height: 5px;
    margin-top: 0.5rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background-color: #dc3545;
    width: 33%;
}

.password-strength.medium {
    background-color: #ffc107;
    width: 66%;
}

.password-strength.strong {
    background-color: #28a745;
    width: 100%;
}

/* RESPONSIVE PARA EL TOOLBAR */
@media (max-width: 767px) {
    .toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .toolbar h1, .user-info {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }
    
    .user-info {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .user-info {
        flex-flow: wrap;
        gap: 0.5rem;
        align-items: stretch;
        justify-content: center;
    }

    .user-info #user-email{
        min-width:100%;
        text-align: center;
    }
    
    .user-info button {
        width: fit-content;
        margin: 0rem 0.25rem;
    }
    
    .editor-toolbar{
        justify-content: space-between;
    }
}