/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
    font-size: 14px;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 0;
}

.btn > * {
    position: relative;
    z-index: 1;
}

.btn:hover::after { opacity: 0.08; }
.btn:active::after { opacity: 0.12; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-soft));
    color: white;
    box-shadow: 0 4px 12px rgba(43, 95, 117, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(43, 95, 117, 0.35);
    transform: translateY(-1px);
}

.btn-primary::after {
    background: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 12px;
}

.btn-ghost:hover {
    background-color: var(--hover-overlay);
    color: var(--text-primary);
}

.btn-ghost svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
}

.btn:active { transform: scale(0.98); }
.btn-full { width: 100%; }

/* Cards */
.card {
    background-color: var(--card-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    animation: fadeUp 0.35s ease-out forwards;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px var(--shadow-medium);
}

/* Post Card Specifics */
.post-card {
    padding: 16px;
    overflow: hidden;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.post-header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.post-header-link:hover .user-info h4 {
    color: var(--primary-color);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.user-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.post-content-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.post-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.post-media-link {
    display: block;
}

.post-content p,
.post-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.text-clamp {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.text-clamp-6 {
    -webkit-line-clamp: 6;
}

.text-clamp-4 {
    -webkit-line-clamp: 4;
}

.text-toggle-btn {
    align-self: flex-end;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 16px;
    background-color: var(--hover-overlay);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.text-toggle-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.text-toggle-btn--inline {
    font-size: 11px;
    padding: 4px 10px;
}

.comment-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-toggle-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.post-media {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 12px;
}

.post-media img,
.post-media video {
    width: 100%;
    object-fit: cover;
    max-height: 400px;
}

.post-media video {
    background: #000;
}

.post-media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
}

.post-media-grid img,
.post-media-grid video {
    aspect-ratio: 1;
    object-fit: cover;
}

/* Post Actions - Refined Design */
.post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--divider-color);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
}

.action-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
    transition: transform 0.2s ease;
}

.action-btn:hover {
    background-color: var(--hover-overlay);
    color: var(--primary-color);
}

.action-btn:hover svg {
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.liked {
    color: #E53935;
}

.action-btn.liked svg {
    stroke: #E53935;
}

.action-btn--share {
    margin-right: auto;
}

.action-count {
    font-variant-numeric: tabular-nums;
}

/* Post Comments */
.post-comments {
    display: none;
    padding-top: 12px;
    border-top: 1px solid var(--divider-color);
    margin-top: 12px;
}

.post-comments.show {
    display: block;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comments-list:empty {
    display: none;
}

.comment-item .comment-text {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inputs */
.input-group {
    margin-bottom: 16px;
    text-align: right;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: none;
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 95, 117, 0.1);
}

.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea.input-field {
    min-height: 120px;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Profile Specifics */
.profile-header {
    text-align: center;
    padding: 24px 0;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 3px solid var(--primary-color);
    padding: 3px;
    background: var(--card-color);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: var(--verified-color);
    border-radius: 50%;
    color: white;
    font-size: 10px;
}

.verified-badge svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.profile-username {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 12px;
    line-height: 1.6;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid var(--divider-color);
    border-bottom: 1px solid var(--divider-color);
}

.stat-item {
    text-align: center;
}

.stat-value { 
    font-weight: 700; 
    font-size: 18px;
    color: var(--text-primary);
    display: block; 
}

.stat-label { 
    font-size: 12px; 
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.comments-header h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.comments-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.comment-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-action {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-action:hover {
    color: var(--primary-color);
}

.comment-action svg {
    width: 14px;
    height: 14px;
}

/* Comment Input */
.comment-input-wrapper {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: var(--surface-color);
    border-radius: 16px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.comment-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.comment-input::placeholder {
    color: var(--text-secondary);
}

.comment-submit,
.btn-submit-comment {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-submit:hover,
.btn-submit-comment:hover {
    background: var(--accent-soft);
}

/* Section Headers */
.section-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* QR Code */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--surface-color);
    border-radius: 16px;
    margin-top: 16px;
}

.qr-code {
    width: 160px;
    height: 160px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.qr-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--card-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 4px 20px var(--shadow-medium);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Search Component */
.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 95, 117, 0.1);
}

.search-input-wrapper svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    width: 100%;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-close-btn:hover {
    background-color: var(--hover-overlay);
    color: var(--text-primary);
}

.search-results {
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* Search Suggestions */
.search-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.search-suggestion-item:hover {
    background-color: var(--hover-overlay);
}

.suggestion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.suggestion-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-username {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
