/* --- Zmienne globalne i Reset --- */
:root {
    --bg-global: #f7f9fa;
    --bg-card: #ffffff;
    --text-main: #0f1419;
    --text-muted: #536471;
    --accent: #1d9bf0;
    --border-color: #eff3f4;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-global);
    font-family: var(--font-stack);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Nawigacja (Navbar) --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
}

.nav-search {
    background-color: var(--bg-global);
    border: 1px solid transparent;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    padding: 8px 18px;
    width: 360px;
    transition: all 0.2s ease;
}

.nav-search:focus-within {
    background-color: var(--bg-card);
    border-color: var(--accent);
}

.nav-search span {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 22px;
}

.nav-search input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 15px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.nav-icon-btn span {
    font-size: 26px;
}

.avatar-trigger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Wyrazista, pulsująca kropka powiadomień */
.notification-badge-container {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 13px;
    height: 13px;
    background-color: #f4212e;
    border-radius: 50%;
    border: 2.5px solid var(--bg-card);
    box-shadow: 0 2px 5px rgba(244, 33, 46, 0.4);
    animation: alert-pulse 2s infinite ease-in-out;
}

@keyframes alert-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); box-shadow: 0 2px 8px rgba(244, 33, 46, 0.6); }
    100% { transform: scale(1); }
}

/* --- SYSTEM DROPDOWNÓW NAWIGACYJNYCH --- */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: slideUpDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpDropdown {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-wrapper.active .dropdown-menu {
    display: block;
}

/* Dropdown powiadomień specyficzne gabaryty */
.dropdown-notifications {
    width: 360px;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
    font-size: 15px;
    font-weight: 800;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.dropdown-list {
    list-style: none;
}

.dropdown-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
    transition: background-color 0.15s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--bg-global);
}

.dropdown-item.unread {
    background-color: #f4f9fd;
}

.dropdown-item .item-text {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.4;
}

.dropdown-item .time-stamp {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
}

.style-like { background-color: #fdeef4; color: #f91880; }
.style-system { background-color: #eaf6ff; color: var(--accent); }

/* Dropdown profilu specyficzne gabaryty */
.dropdown-profile {
    width: 220px;
}

.dropdown-profile-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-global);
}

.user-full-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.user-handle-name {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-profile .dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: background-color 0.15s ease;
}

.dropdown-profile .dropdown-link:hover {
    background-color: var(--bg-global);
}

.dropdown-profile .dropdown-link span {
    font-size: 18px;
    color: var(--text-muted);
}

.dropdown-profile .divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.logout-link {
    color: #f4212e !important;
}

.logout-link span {
    color: #f4212e !important;
}

/* --- UKŁAD: Szeroki i Wyśrodkowany --- */
.grid-centered {
    max-width: 960px;
    margin: 28px auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 0 20px;
}

.top-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 24px;
}

@media (max-width: 768px) {
    .top-widgets, .profile-layout-grid {
        grid-template-columns: 1fr !important;
    }
    .nav-search {
        display: none;
    }
}

.widget-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
}

.horizontal-recommendation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.horizontal-recommendation-list li {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rec-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.rec-name {
    font-size: 15px;
    font-weight: 700;
}

.rec-tag {
    font-size: 13px;
    color: var(--text-muted);
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- Komponenty wspólne --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

.avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.btn {
    font-family: var(--font-stack);
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--text-main);
    color: #fff;
    padding: 10px 22px;
    font-size: 15px;
}

.btn-primary:hover {
    background-color: #272c30;
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #cfd9de;
    transition: background-color 0.15s ease;
}

.btn-secondary:hover {
    background-color: #f7f9fa;
}

.tag-badge {
    background-color: var(--bg-global);
    padding: 8px 14px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
    display: inline-block;
}

.tag-badge:hover {
    background-color: #eff3f4;
    color: var(--text-main);
}

/* --- ZABEZPIECZONY FORMULARZ UDOSTĘPNIANIA (Zawsze widoczny) --- */
.card-publish {
    display: flex !important;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 16px;
    visibility: visible !important;
    opacity: 1 !important;
}

.publish-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.publish-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.input-link {
    width: 100%;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    background-color: transparent;
}

.input-note {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: var(--font-stack);
    resize: none;
    height: 70px;
    color: var(--text-muted);
    background-color: transparent;
}

.publish-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.tag-badge-input {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--bg-global);
    padding: 6px 14px;
    border-radius: 9999px;
}

.publish-right-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.char-counter {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- KARTA WPISU (Zunifikowane style typografii) --- */
.feed-item-split {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.feed-item-split:hover {
    border-color: #ccd6dd;
}

.item-main-body {
    flex-grow: 1;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 16px;
}

.verified-badge-inline {
    color: var(--accent);
    font-size: 18px !important;
    display: inline-block;
    vertical-align: middle;
}

.item-content {
    margin-top: 12px;
    margin-bottom: 16px;
}

.item-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    line-height: 1.35;
}

.item-title a:hover {
    color: var(--accent);
}

.item-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 14px 0;
}

.item-excerpt {
    color: var(--text-muted);
    font-size: 16px; 
    line-height: 1.6;
}

.item-author-note {
    background-color: #f0f7fc;
    border-left: 3px solid var(--accent);
    border-radius: 4px var(--border-radius-md) var(--border-radius-md) 4px;
    padding: 16px 20px;
    margin-top: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.note-icon {
    color: var(--accent);
    font-size: 22px;
    margin-top: 2px;
}

.item-author-note p {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.6;
}

.item-author-note strong {
    color: var(--accent);
}

.item-footer-tags {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tag-badge-small {
    background-color: var(--bg-global);
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
    display: inline-block;
}

.tag-badge-small:hover {
    background-color: #eff3f4;
    color: var(--text-main);
}

/* --- PRZYCISKI AKCJI PIONOWE --- */
.item-side-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-left: 1px solid var(--border-color);
    padding-left: 24px;
    min-width: 64px;
}

.action-btn-vertical {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-stack);
    opacity: 0.35;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.action-btn-vertical span.material-symbols-outlined {
    font-size: 24px;
}

.action-btn-vertical .count {
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.action-btn-vertical.btn-like:hover {
    opacity: 1;
    color: #f91880;
}

.action-btn-vertical.btn-share:hover {
    opacity: 1;
    color: #00ba7c;
}

.action-btn-vertical.btn-bookmark:hover {
    opacity: 1;
    color: var(--accent);
}

/* --- STYLE PROFILU --- */
.profile-hero-card {
    padding: 0 0 24px 0;
    overflow: hidden;
}

.profile-cover-placeholder {
    height: 150px;
    background: linear-gradient(135deg, #e8f5fe 0%, #cce7ff 100%);
}

.profile-avatar-wrapper {
    padding: 0 24px;
    margin-top: -60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.profile-avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-card);
    background-color: var(--bg-card);
}

.btn-edit-profile {
    margin-bottom: 4px;
}

.profile-bio-data {
    padding: 0 24px;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified-badge {
    color: var(--accent);
    font-size: 24px !important;
}

.profile-handle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.profile-bio-text {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 16px;
    max-width: 720px;
}

.profile-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 15px;
    color: var(--text-muted);
}

.profile-stats-row strong {
    color: var(--text-main);
}

.profile-layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: flex-start;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 15px;
    color: var(--text-muted);
}

.profile-info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.profile-info-list span.material-symbols-outlined {
    font-size: 20px;
    color: var(--text-muted);
}

.profile-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 4px;
}

.tab-btn {
    flex-grow: 1;
    background: none;
    border: none;
    padding: 14px;
    font-family: var(--font-stack);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    background-color: var(--bg-global);
    color: var(--text-main);
}

.tab-btn.active {
    background-color: var(--bg-global);
    color: var(--accent);
}