/**
 * Klasičan Gejming - Components
 * Toast notifications, lightbox, modals, badges itd.
 */

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 400px;
}

.toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 20px;
}

.toast span {
    font-size: 14px;
    line-height: 1.5;
}

.toast-success {
    border-color: var(--success);
}

.toast-success i {
    color: var(--success);
}

.toast-error {
    border-color: var(--error);
}

.toast-error i {
    color: var(--error);
}

.toast-warning {
    border-color: var(--warning);
}

.toast-warning i {
    color: var(--warning);
}

.toast-info {
    border-color: #3B82F6;
}

.toast-info i {
    color: #3B82F6;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--accent-pink);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.pagination .active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.dropdown.open .dropdown-menu,
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--accent-pink);
}

.dropdown-menu .divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-pink);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== Responsive Toast ===== */
@media (max-width: 767px) {
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* ===== Page Headers ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.page-header-content h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.page-header-content h1 i {
    color: var(--accent-pink);
}

.page-header-content p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===== Search Header & Form ===== */
.search-header {
    text-align: center;
    padding: 60px 0 40px;
    max-width: 700px;
    margin: 0 auto;
}

.search-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-form-large {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-form-large input {
    flex: 1;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-form-large input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 20px rgba(255, 45, 117, 0.2);
}

.search-form-large button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form-large button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 45, 117, 0.4);
}

.search-results-info {
    color: var(--text-secondary);
    font-size: 15px;
}

.search-results-info strong {
    color: var(--accent-pink);
}

/* ===== Category Header ===== */
.category-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.9) 0%, rgba(10, 10, 20, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--category-color, var(--accent-pink)) 0%, transparent 60%);
    opacity: 0.1;
}

.category-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--category-color, var(--accent-pink)) 0%, rgba(255, 45, 117, 0.6) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(255, 45, 117, 0.3);
}

.category-info {
    position: relative;
    z-index: 1;
}

.category-info h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.category-info p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    max-width: 600px;
}

.article-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
}

.article-count::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--category-color, var(--accent-pink));
    border-radius: 50%;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h2,
.empty-state h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    transform: translateY(-2px);
}

.pagination span.current,
.pagination a.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.pagination .prev,
.pagination .next {
    padding: 0 20px;
}

.pagination .prev i,
.pagination .next i {
    font-size: 12px;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Load More Button ===== */
.load-more {
    text-align: center;
    margin-top: 40px;
}

#loadMoreBtn,
.load-more .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

#loadMoreBtn:hover,
.load-more .btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 45, 117, 0.2);
}

#loadMoreBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#loadMoreBtn i {
    transition: transform 0.3s ease;
}

#loadMoreBtn:hover i {
    transform: rotate(180deg);
}

/* ===== Filters Bar ===== */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.filters-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.filters-form input,
.filters-form select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

.filters-form input {
    flex: 1;
    max-width: 300px;
}

.filters-form select {
    min-width: 150px;
}

.filters-form input:focus,
.filters-form select:focus {
    outline: none;
    border-color: var(--accent-pink);
}

/* ===== Tag Page Header ===== */
.tag-header {
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 40px;
}

.tag-header .tag-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.tag-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    margin-bottom: 12px;
}

.tag-header h1 span {
    color: var(--accent-pink);
}

.tag-header p {
    color: var(--text-secondary);
}

/* ===== Profile/Author Header ===== */
.profile-header,
.author-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: 40px;
}

.profile-avatar,
.author-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-pink);
    flex-shrink: 0;
}

.profile-avatar img,
.author-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1,
.author-info h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.profile-stats,
.author-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.profile-stats .stat,
.author-stats .stat {
    text-align: center;
}

.profile-stats .stat-value,
.author-stats .stat-value {
    display: block;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.profile-stats .stat-label,
.author-stats .stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .search-header {
        padding: 40px 0 30px;
    }
    
    .search-header h1 {
        font-size: 1.8rem;
    }
    
    .search-form-large {
        flex-direction: column;
    }
    
    .search-form-large button {
        width: 100%;
        justify-content: center;
    }
    
    .category-header {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .category-info h1 {
        font-size: 1.6rem;
    }
    
    .profile-header,
    .author-header {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filters-form {
        flex-wrap: wrap;
    }
    
    .filters-form input {
        max-width: 100%;
    }
}
