/**
 * JobsFlow Közösség - CSS
 * Skool.com-szerű design
 */

/* Custom background color for community pages */
main.bg-gray-50 {
    background-color: #f8f7f5 !important;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prevent word-wrap issues - break long words */
.break-words {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Hide scrollbar but allow scrolling */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Ultra thin scrollbar (2px) */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    height: 2px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 2px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Mobile-specific styles */
@media (max-width: 640px) {
    /* Prevent horizontal overflow */
    main {
        overflow-x: hidden;
    }

    /* Ensure cards don't overflow */
    article {
        max-width: 100%;
    }

    /* Topic filter chips */
    .topic-chip {
        max-width: 150px;
    }

    /* Modal fullscreen on mobile */
    #post-modal > div:last-child {
        inset: 0;
        border-radius: 0;
    }

    #create-post-modal > div:last-child {
        inset: 0;
        border-radius: 0;
    }
}

/* Sticky header support */
@supports (position: sticky) {
    .sticky-header {
        position: sticky;
        top: 0;
        z-index: 40;
    }
}

/* Modal animations */
#post-modal,
#create-post-modal {
    transition: opacity 0.2s ease-out;
}

#post-modal.hidden,
#create-post-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Avatar placeholder */
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 500;
}

/* Post card hover effect */
article.post-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

article.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Company mention badges */
.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #f3f4f6;
    border-radius: 9999px;
    font-size: 12px;
    max-width: 150px;
}

.company-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab navigation */
.tab-nav a {
    position: relative;
}

.tab-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #4f46e5;
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Event card styles */
.event-card {
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* Member card styles */
.member-card {
    transition: background-color 0.2s ease;
}

.member-card:hover {
    background-color: #f9fafb;
}

/* Form focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #6366f1;
}

/* Button states */
.btn-primary {
    background-color: #4f46e5;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #fff;
    color: #1f2937;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
    max-width: min(420px, 90vw);
    min-width: 300px;
    pointer-events: auto;
    animation: toastSlideUp 0.3s ease forwards;
}

.toast.toast-hide {
    animation: toastSlideDown 0.25s ease forwards;
}

/* Icon wrapper - circle background */
.toast-icon-wrapper {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon-wrapper svg {
    flex-shrink: 0;
}

.toast-icon-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.toast-icon-error {
    background-color: #fee2e2;
    color: #dc2626;
}

.toast-icon-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.toast-icon-info {
    background-color: #dbeafe;
    color: #2563eb;
}

.toast-message {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    color: #374151;
}

/* Close button */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 4px;
}

.toast-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Toast type borders */
.toast-success {
    border-left: 4px solid #16a34a;
}

.toast-error {
    border-left: 4px solid #dc2626;
}

.toast-warning {
    border-left: 4px solid #d97706;
}

.toast-info {
    border-left: 4px solid #2563eb;
}

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

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

/* Whitespace pre-wrap for content */
.content-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive image container */
.image-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    border-radius: 8px;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Circular Progress Indicator for uploads */
.upload-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-progress-ring svg {
    transform: rotate(-90deg);
}

.upload-progress-ring .progress-bg {
    stroke: #374151;
    fill: none;
}

.upload-progress-ring .progress-bar {
    stroke: #2DD4BF;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.2s ease;
}

/* Upload overlay for buttons */
.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}
