:root {
    --bg-color: #F5F5F7;
    --text-color: #4A4A4A;
    --text-white: #E2E2E5;
    --primary-color: #ED1C24;
    --about-us-color: #1A73E8;
    --areas-of-work-color: #4CAF50;
    --current-events-color: #FFA726;
    --works-articles-color: #E53935;
    --works-articles-bg: #f8f5ff;
    --primary-dark: #971115;
    --white: #ffffff;
    --shadow: rgba(0,0,0,0.1);
}

@font-face {
  font-family: 'Orbitron Regular';
  src: url('/fonts/Orbitron-Regular.ttf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* Works and Articles Page Main Container */
.works-and-articles-page {
    padding: 0rem 0;
    margin: 0;
    position: relative;
    width: 99.2vw;
    overflow: hidden;
    background: var(--bg-color);
}

.works-and-articles-page .container {
    margin: 0px auto;
    padding: 0px 250px;
    position: relative;
    padding-block: 4rem !important;
}

@media (max-width: 1440px) {
    .works-and-articles-page .container {
        padding: 0 150px;
        padding-block: 4rem !important;
    }
}

@media (max-width: 1200px) {
    .works-and-articles-page .container {
        padding: 0 100px;
        padding-block: 4rem !important;
    }
}

@media (max-width: 768px) {
    .works-and-articles-page .container {
        padding: 0 1.5rem;
        padding-block: 4rem !important;
    }
}

@media (max-width: 360px) {
    .works-and-articles-page .container {
        padding: 0 1rem;
        padding-block: 4rem !important;
    }
}

.works-and-articles-page h2 {
    font-family: "Orbitron Regular", sans-serif;
    font-size: 3rem;
    font-weight: 500;
    color: var(--works-articles-color);
    text-align: left;
    letter-spacing: 2px;
    margin-bottom: 3rem;
    border: none;
    padding: 0;
}

/* Category Filter Buttons */
.category-filter-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.category-btn {
    padding: 0.8rem 2rem;
    border: 2px solid var(--works-articles-color);
    background: transparent;
    color: var(--works-articles-color);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-btn:hover {
    background: var(--works-articles-color);
    color: white;
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--works-articles-color);
    color: white;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

@media (max-width: 768px) {
    .category-filter-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .category-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 250px;
    }
}

/* Search Bar Styles */
.search-wrapper {
    margin-bottom: 2rem;
    order: -2;
}

.search-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Josefin Sans', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.search-results-count {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(237, 28, 36, 0.2);
}

/* No Results Styles */
.no-results {
    grid-column: 1 / -1;
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.no-results h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-results p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.clear-all-filters {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-filters:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.search-input {
    color: #007BFF; /* plava boja slova */
    animation: textPulse 1.5s ease-in-out infinite; /* efekt titranja */
}

/* Efekt blagoga titranja (svjetliji i tamniji ton plave) */
@keyframes textPulse {
    0% {
        color: #007BFF;
        text-shadow: 0 0 2px rgba(0, 123, 255, 0.3);
    }
    50% {
        color: #309AFF;
        text-shadow: 0 0 4px rgba(0, 123, 255, 0.6);
    }
    100% {
        color: #007BFF;
        text-shadow: 0 0 2px rgba(0, 123, 255, 0.3);
    }
}

/* Za placeholder (ako želiš i on da bude plav, ali ne titra) */
.search-input::placeholder {
    color: #66B2FF;
    opacity: 0.8;
}

/* Category Titles */
.category-title {
    margin: 2rem 0 1.5rem 0;
    text-align: center;
    display: block;
}

.category-title h3 {
    font-family: "Orbitron Regular", sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--works-articles-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    position: relative;
}

.category-title h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--works-articles-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.category-title:first-of-type {
    margin-top: 0;
}

@media (max-width: 768px) {
    .category-title h3 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .category-title h3::after {
        width: 40px;
        height: 2px;
    }
}

/* Works and Articles Wrapper */
.works-and-articles-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Article Content */
.article-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 4px solid var(--works-articles-color);
    padding-bottom: 3.5rem;
}

.article-content::after {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--works-articles-color);
    font-size: 1.1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.works-and-articles-item:hover .article-content::after {
    opacity: 1;
    transform: translateX(3px);
}

.works-and-articles-item {
    text-decoration: none;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(176, 39, 39, 0.1);
}

.works-and-articles-item:hover {
    transform: translateY(-5px) scale(1);
    box-shadow: 0 8px 25px rgba(176, 39, 39, 0.2);
}

.works-and-articles-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    margin: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.article-meta {
    margin-bottom: 1rem;
}

.article-meta .author {
    font-size: 0.9rem;
    color: var(--works-articles-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 1.2rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Works and Articles Grid Layout */
.works-and-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

@media (max-width: 1440px) {
    .works-and-articles-wrapper {
        gap: 1rem;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .works-and-articles-wrapper {
        gap: 1rem;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .works-and-articles-page {
        margin-left: calc(-50vw + 50%);
        width: 100vw;
    }
    
    .works-and-articles-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .works-and-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .works-and-articles-grid {
        padding-top: 1rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-content {
        padding: 1.5rem;
        border-left-width: 3px;
        padding-bottom: 3.5rem;
    }
    
    .article-content::after {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1rem;
    }
    
    .article-content h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .article-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 1.2rem;
        padding-bottom: 3.5rem;
    }
    
    .article-content::after {
        top: 1.2rem;
        right: 1.2rem;
        font-size: 0.9rem;
    }
    
    .article-content h3 {
        font-size: 1.1rem;
    }
    
    .article-content p {
        font-size: 0.85rem;
    }

}

/* Animation for filtered items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.works-and-articles-item:not(.hidden) {
    animation: fadeInUp 0.5s ease forwards;
}

.works-and-articles-item.hidden {
    animation: fadeOut 0.3s ease forwards;
}