
/* ===== СЕКЦИИ ===== */
.section {
    margin-bottom: 20px;
}

.section:last-child {
    margin-bottom: 0;
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.grid-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(640px, 1fr));
    gap: 16px;
}

.grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(640px, 1fr));
    gap: 16px;
}

/* ===== КАРТОЧКА СОБЫТИЯ ===== */
.event-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: 0.15s;
    cursor: pointer;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 70px;
}

.event-card:hover {
    border-color: #0b3b5c;
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.event-card:active {
    transform: scale(0.99);
}

.event-card .event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.event-card .event-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0b3b5c;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
}

.event-card .event-name .badge {
    font-size: 0.6rem;
    font-weight: 600;
    color: #334155;
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 30px;
    font-family: monospace;
    white-space: nowrap;
}

.event-card .badge {
    font-size: 0.7rem;
    flex-shrink: 0;
    align-self: center;
}

/* ===== КАРТОЧКА ССЫЛКИ ===== */
.link-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: 0.15s;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 80px;
    position: relative;
    user-select: none;
}

.link-card:hover {
    border-color: #0b3b5c;
    background: #f1f5f9;
}

.link-card.is-new {
    background: #fefce8;
    border-color: #fbbf24;
    animation: pulse-new 2s ease-in-out 3;
}

.link-card.is-new:hover {
    background: #fef9c3;
    border-color: #f59e0b;
}

@keyframes pulse-new {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.1);
    }
}

.link-card .new-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 10;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.link-card .drag-handle {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.2rem;
    color: #94a3b8;
    opacity: 0.3;
    transition: 0.15s;
    cursor: grab;
    user-select: none;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 5;
}

.link-card .drag-handle:hover {
    opacity: 0.9;
    background: rgba(11, 59, 92, 0.08);
}

.link-card .drag-handle:active {
    cursor: grabbing;
}

.link-card.dragging {
    opacity: 0.4;
    border-color: #0b3b5c;
    transform: scale(0.98);
}

.link-card.drag-over {
    border-color: #0b3b5c;
    background: #e9edf2;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(11, 59, 92, 0.15);
}

.link-card .link-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-right: 30px;
}

.link-card .link-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0b3b5c;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
}

.link-card .link-name a {
    color: #0b3b5c;
    text-decoration: none;
    word-break: break-word;
}

.link-card .link-name a:hover {
    text-decoration: underline;
}

.link-card .link-name .link-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.link-card .link-description {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
    margin-top: 4px;
    user-select: text;
}

.link-card .link-description .truncated {
    display: inline;
}

.link-card .link-description .full {
    display: none;
}

.link-card .link-description.expanded .truncated {
    display: none;
}

.link-card .link-description.expanded .full {
    display: inline;
}

.link-card .link-description a,
.link-card .link-description .content-link {
    color: #0b3b5c;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #94a3b8;
    transition: 0.15s;
    font-weight: 500;
}

.link-card .link-description a:hover,
.link-card .link-description .content-link:hover {
    color: #1a6b8a;
    text-decoration-color: #0b3b5c;
}

.link-card .link-description ul,
.link-card .link-description ol {
    margin: 4px 0 2px 0;
    padding-left: 20px;
    list-style: none;
}

.link-card .link-description li {
    margin: 2px 0;
    position: relative;
    padding-left: 4px;
}

.link-card .link-description li::before {
    content: "•";
    position: absolute;
    left: -16px;
    color: #0b3b5c;
    font-weight: bold;
}

.link-card .link-description ul ul li::before {
    content: "◦";
}

.link-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.link-toggle {
    background: none;
    border: none;
    color: #0b3b5c;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #94a3b8;
    transition: 0.15s;
    border-radius: 4px;
    user-select: none;
}

.link-toggle:hover {
    color: #1a6b8a;
    text-decoration-color: #0b3b5c;
    background: rgba(11, 59, 92, 0.04);
}

.link-toggle:active {
    transform: scale(0.97);
}

.link-toggle:focus-visible {
    outline: 2px solid #0b3b5c;
    outline-offset: 2px;
}
