/* =========================================
           CARDS DE NOTAS
   ========================================= */

/* Containers de notas */
.notes-container,
#notes-public-container,
#notes-other-public-container,
#notes-favorite-public-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 100%;
    margin: 1.5rem auto;
    padding: 0.5rem;
    box-sizing: border-box;
    perspective: 1000px; /* Para efeito 3D nos cards */
}

/* Animação de entrada para os cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card de nota */
.note-card-public {
    background: var(--gradient-dark);
    color: var(--color-text);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--color-shadow), 0 0 8px rgba(0, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-family: var(--font-main);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    animation: cardFadeIn 0.5s ease forwards;
    backface-visibility: hidden; /* Suaviza a animação */
}

/* Efeito de borda neon */
.note-card-public::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-neon);
    opacity: 0.7;
}

/* Efeito hover */
.note-card-public:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 0 10px 25px var(--color-shadow), 0 0 15px var(--color-primary);
    border-color: var(--color-primary);
}

/* Efeito de brilho ao passar o mouse */
.note-card-public::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-15deg);
    transition: left 0.8s ease;
    pointer-events: none;
}

.note-card-public:hover::after {
    left: 100%;
}

/* Cabeçalho do card */
.note-card-header {
    margin-bottom: 1rem;
    position: relative;
}

/* Título do card */
.note-card-public h4 {
    font-size: 1.4rem;
    margin: 0 0 0.8rem 0;
    color: var(--color-primary);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    font-family: var(--font-headings);
    letter-spacing: 0.5px;
    line-height: 1.3;
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Conteúdo do card */
.note-card-content {
    flex: 1;
    margin-bottom: 1rem;
}

.note-card-public p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-public .note-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Metadados do card */
.note-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 0.8rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.note-meta-item {
    flex-basis: calc(50% - 0.5rem);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.note-meta-item i {
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* Tags */
.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.note-tag {
    background-color: var(--color-dark-gray);
    color: var(--color-secondary);
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--color-secondary);
    transition: all 0.2s ease;
}

.note-tag:hover {
    background-color: var(--color-secondary);
    color: var(--color-background);
    box-shadow: 0 0 8px var(--color-secondary);
}

/* Botões de ação */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.8rem;
}

.action-buttons-left,
.action-buttons-right {
    display: flex;
    gap: 0.8rem;
}

.action-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.action-button:hover {
    color: var(--color-primary);
    background-color: rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.action-button:active {
    transform: translateY(0);
}

/* Efeito de ondulação nos botões */
.action-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(0, 255, 255, 0.5);
    opacity: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.5s ease;
}

.action-button:active::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(20);
    transition: all 0s;
}

/* Botões específicos */
.action-button.favorite {
    color: var(--color-text-muted);
}

.action-button.favorite.active {
    color: var(--color-yellow);
}

.action-button.favorite:hover {
    color: var(--color-yellow);
}

.action-button.edit:hover {
    color: var(--color-edit);
}

.action-button.delete:hover {
    color: var(--color-delete);
}

.action-button.view:hover {
    color: var(--color-view);
}

/* Tooltip para botões */
.action-button .tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-dark-gray);
    color: var(--color-text);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 5px var(--color-shadow);
    z-index: 10;
}

.action-button:hover .tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -30px;
}

/* Indicador de privacidade */
.privacy-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.privacy-indicator.public {
    color: var(--color-edit);
}

.privacy-indicator.private {
    color: var(--color-delete);
}

.privacy-indicator:hover {
    transform: scale(1.2);
}

/* Indicador de data */
.date-indicator {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background-color: rgba(26, 26, 26, 0.8);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

/* Variações de cores para os cards */
.note-card-primary {
    border-color: var(--color-primary);
}

.note-card-primary::before {
    background: linear-gradient(90deg, var(--color-primary), transparent);
}

.note-card-secondary {
    border-color: var(--color-secondary);
}

.note-card-secondary::before {
    background: linear-gradient(90deg, var(--color-secondary), transparent);
}

.note-card-accent {
    border-color: var(--color-accent);
}

.note-card-accent::before {
    background: linear-gradient(90deg, var(--color-accent), transparent);
}

.note-card-yellow {
    border-color: var(--color-yellow);
}

.note-card-yellow::before {
    background: linear-gradient(90deg, var(--color-yellow), transparent);
}

/* Estado de carregamento */
.note-card-loading {
    position: relative;
    pointer-events: none;
    overflow: hidden;
}

.note-card-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Contador de cards */
.notes-count {
    width: 100%;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.notes-count strong {
    color: var(--color-primary);
}

/* Responsividade */
@media (max-width: 768px) {
    .notes-container,
    #notes-public-container,
    #notes-other-public-container,
    #notes-favorite-public-container {
        gap: 1rem;
    }
    
    .note-card-public {
        max-width: 100%;
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .note-meta-item {
        flex-basis: 100%;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .action-buttons-left,
    .action-buttons-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Grid view para telas grandes */
@media (min-width: 1200px) {
    .notes-grid-view .note-card-public {
        max-width: 280px;
    }
}