/* --- Meus Links Premium Styles --- */

:root {
    --primary-gradient: linear-gradient(135deg, #005f73, #0a9396);
    --card-bg: #ffffff;
    --card-hover-bg: #f8fafc;
    --text-color: #334155;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 15px;
}

.links-header h3 {
    margin: 0;
    color: #0f172a;
    /* Slate 900 */
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.links-actions {
    display: flex;
    gap: 10px;
}

.btn-premium {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-add {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 6px rgba(10, 147, 150, 0.2);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(10, 147, 150, 0.3);
    filter: brightness(1.1);
}

.btn-edit-mode {
    background: #e2e8f0;
    /* Slate 200 */
    color: #475569;
}

.btn-edit-mode:hover {
    background: #cbd5e1;
    color: #334155;
}

.btn-edit-mode.active {
    background: #f59e0b;
    /* Amber 500 */
    color: white;
    animation: pulse 2s infinite;
}

/* --- Grid Layout --- */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.link-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    height: 100%;
}

/* Hover effect only in normal mode */
.links-grid:not(.edit-mode) .link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #e2e8f0;
}

.link-icon {
    width: 50px;
    height: 50px;
    background: #f0f9ff;
    /* Sky 50 */
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #0284c7;
    /* Sky 600 */
    transition: background 0.3s;
}

.links-grid:not(.edit-mode) .link-card:hover .link-icon {
    background: #0ea5e9;
    color: white;
}

.link-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
    word-break: break-word;
}

.link-url {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* --- Edit Mode Styles --- */
.links-grid.edit-mode .link-card {
    cursor: grab;
    border: 2px dashed #cbd5e1;
    background: #fff;
    animation: shake 0.5s ease-in-out infinite alternate;
    /* Sutil alerta */
    animation-play-state: paused;
    /* Só anima no hover ou algo assim se quiser */
}

.links-grid.edit-mode .link-card:active {
    cursor: grabbing;
}

/* Edit Overlay (aparece só no edit mode) */
.edit-actions {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    gap: 8px;
}

.links-grid.edit-mode .link-card .edit-actions {
    display: flex;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: transform 0.2s;
}

.btn-edit-item {
    background: #3b82f6;
    /* Blue 500 */
}

.btn-delete-item {
    background: #ef4444;
    /* Red 500 */
}

.action-btn:hover {
    transform: scale(1.1);
}

.drag-handle {
    display: none;
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 10px;
    cursor: grab;
}

.links-grid.edit-mode .link-card .link-icon {
    display: none;
    /* Hide icon to show drag handle or keep both */
}

.links-grid.edit-mode .link-card .drag-handle {
    display: block;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

/* --- Modal Styles Fix --- */
.modal-overlay {
    backdrop-filter: blur(5px);
}

/* --- Animations --- */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(1deg);
    }

    75% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.ghost {
    opacity: 0.5;
    background: #e2e8f0;
    border: 2px dashed #94a3b8;
}