/* Estilos personalizados */
:root {
    --card-default-color: #f8f9fa;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

.hidden {
    display: none !important;
}

.card {
    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;
}

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

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

.card-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%);
}

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

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

.card-content {
    min-height: 5rem;
    padding: 0.5rem;
    font-size: 0.8rem;
    border: 1px dashed transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.card-content * {
    font-size: 0.8rem !important;
}

.card-content br {
    content: "";
    display: block;
    margin-bottom: 0.5em;
}

.card-content p {
    margin: 0 0 0.5em 0;
}

.card-content ul, .card-content ol {
    margin: 0;
    margin-bottom: 0.5em;
    padding-left: 0.8rem;
}

.card-content li {
    margin: 0;
}

.card-content.editable {
    border-color: rgba(0,0,0,0.2);
    background-color: rgba(255,255,255,0.2);
    min-height: 10rem;
    margin-bottom: 0rem;
    cursor: text;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0px;
}

.card-actions.content-actions{
	position: absolute;
	bottom: 0.8em;
	right: 0.8em;
}

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

.color-picker {
    display: none;
    gap: 0.25rem;
    margin: 0.5rem 0rem;
    flex-wrap: wrap;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

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

/* CSS RESPONSIVE MEJORADO PARA CARDS */
.cards-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) {
    .cards-container {
        grid-template-columns: 1fr;
    }
}

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

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

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

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

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

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

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

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

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

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

.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%;
    max-width: 50%;
    display: flex;
    margin-bottom: 0px;
}

.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);
}

.text-bold {
    font-weight: bold;
}

.text-italic {
    font-style: italic;
}

.text-underline {
    text-decoration: underline;
}

.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;
}

.content-area {
    width: 100%;
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.sync-status {
    font-size: 0.8rem;
    color: #6c757d;
    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;
	}

	.editor-toolbar #add-card-btn{
		font-size: 0px;
	}

	.editor-toolbar #add-card-btn i{
		font-size: 1rem;
	}

}