/**
 * Afere.cc - Glavni CSS
 */
 
 /* Firefox scrollbar fix */
html {
    scrollbar-width: thin;
    scrollbar-color: #666 #0f0f0f;
}

body {
    overflow-anchor: none;
}

/* Firefox fix - primijeni samo na body i glavne kontejnere, NE na hero */
body,
.header,
.footer,
.article-page,
.search-results-section {
    -moz-backface-visibility: hidden;
    -moz-transform: translate3d(0, 0, 0);
}

/* Eksplicitno isključi hero sekciju */
.hero,
.hero * {
    -moz-backface-visibility: visible !important;
    -moz-transform: none !important;
}
 
/* ===== RESET & OSNOVNI STILOVI ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #0f0f0f;
    --color-bg-card: #1a1a1a;
    --color-bg-secondary: #252525;
    --color-text: #fafafa;
    --color-text-muted: #a0a0a0;
    --color-accent: #e63946;
    --color-accent-hover: #d62828;
    --color-border: #333333;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== HEADER ===== */
.header {
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-card);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.logo:hover {
    color: var(--color-accent-hover);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.hero-content {
    max-width: 48rem;
    width: 100%;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

/* ===== SEARCH BOX ===== */
.search-box {
    position: relative;
    margin-bottom: 2rem;
    z-index: 100;
    -moz-transform: none !important;
    -moz-backface-visibility: visible !important;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%) !important;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-text-muted);
}

.search-input {
    width: 100%;
    padding: 1.5rem 1rem 1.5rem 3rem;
    font-size: 1.125rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: var(--color-accent);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    -moz-transform: none !important;
    -moz-backface-visibility: visible !important;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--color-border);
}

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

.suggestion-item:hover {
    background-color: var(--color-bg-secondary);
}

.search-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    color: white;
}

.btn-secondary {
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg-card);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-tooltip {
    position: relative;
}

.btn-tooltip:hover::after {
    content: attr(aria-label); /* koristi aria-label kao tekst tooltipa */
    position: absolute;
    bottom: 130%; /* iznad gumba */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
    z-index: 999;
}

.btn-tooltip::after {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ===== POPULAR QUERIES ===== */
.popular-queries {
    text-align: center;
    position: relative;
    z-index: 1;
}

.popular-queries-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.popular-queries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.query-tag {
    padding: 0.5rem 1rem;
    background-color: var(--color-bg-secondary);
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.query-tag:hover {
    background-color: var(--color-accent);
    color: white;
}

/* ===== SEARCH RESULTS ===== */
.search-header {
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-card);
    padding: 1rem 0;
}

.search-results-section {
    padding: 2rem 0;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: 250px 1fr;
    }
}

/* ===== FILTERS ===== */
.filters-sidebar {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.filters-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.filter-select {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-text);
    font-size: 0.875rem;
}

/* ===== ARTICLE CARD ===== */
.article-card {
    display: block;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
}

.article-card:hover {
    border-color: var(--color-accent);
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--color-accent);
}

.article-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.article-snippet {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===== ARTICLE PAGE ===== */
.article-page {
    padding: 3rem 0;
}

.article-container {
    max-width: 56rem;
    margin: 0 auto;
}

.article-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-badge {
    padding: 0.375rem 0.75rem;
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--color-accent);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.article-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .article-page-title {
        font-size: 3rem;
    }
}

.article-page-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.article-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.article-featured-image {
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content h2 {
    font-size: 1.875rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--color-accent);
    text-decoration: underline;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.tag-link {
    padding: 0.375rem 0.75rem;
    background-color: var(--color-bg-secondary);
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.tag-link:hover {
    background-color: var(--color-accent);
    color: white;
}

/* ===== SHARE BUTTONS ===== */
.share-section {
    margin-bottom: 2rem;
}

.share-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-info {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-card);
    padding: 1.5rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--color-accent);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden {
    display: none;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* ===== ALERT/MESSAGE ===== */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.alert-error {
    background-color: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.3);
    color: var(--color-accent);
}

.alert-info {
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--color-text-muted);
}

.no-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results-text {
    color: var(--color-text-muted);
}

/* ===== EXTRA ===== */
/* Kontakt forma layout */
.contact-form-wrapper {
    margin-top: 2rem;
}

.contact-form-wrapper form {
    max-width: 640px;
}

/* Grupe polja, razmaci */
.contact-form-wrapper .form-group {
    margin-bottom: 1.25rem;
}

/* Label i polja */
.contact-form-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.contact-form-wrapper input[type="text"],
.contact-form-wrapper input[type="email"],
.contact-form-wrapper input[type="password"],
.contact-form-wrapper input[type="tel"],
.contact-form-wrapper textarea {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.35);
    color: inherit;
    font: inherit;
    box-sizing: border-box;
}

.contact-form-wrapper textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-form-wrapper .btn.btn-primary {
    margin-top: 0.5rem;
}

.contact-form-wrapper .alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.contact-form-wrapper .alert-success {
    background-color: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.contact-form-wrapper .alert-danger {
    background-color: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.5);
}

.contact-meta-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .contact-form-wrapper form {
        max-width: 100%;
    }
}
