/* ==========================================================================
   NiškeNekretnine.rs - Main Stylesheet
   Based on Style Guide specifications
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (from Style Guide)
   -------------------------------------------------------------------------- */
:root {
    /* Editorial palette — fixed defaults.
       Tenants that want a custom brand color override --terracotta / --navy
       via City.customCss (raw CSS injected into <head> after app.css, so
       :root { --terracotta: #xxx; } in customCss takes priority).
       The old chain on var(--color-primary) was removed because the entity
       default (#2563eb generic blue) was overriding the editorial accent
       on every tenant that hadn't explicitly set a brand color. */
    --cream:        #FAF8F4;
    --warm-white:   #FFFCF7;
    --paper:        #F3EFE7;
    --navy:         #1C2D3D;
    --navy-soft:    #2A3F55;
    --terracotta:   #B8755C;
    --terracotta-d: #9A5E47;
    --ink:          #1C1612;
    --taupe:        #7A6E64;
    --hairline:        rgba(28, 22, 18, 0.08);
    --hairline-strong: rgba(28, 22, 18, 0.18);

    /* Editorial typography — Cormorant Garamond for display (clean balkan
       latin: clear haček on š/č/ž, plain j hook), Inter Tight for body. */
    --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    --font-body:    'Inter Tight', 'Open Sans', system-ui, -apple-system, sans-serif;

    /* Colors — legacy names kept for backward compat, remapped to editorial palette */
    --primary: #1e3a5f;
    --secondary: #f47920;
    --accent: #2563eb;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;

    /* Legacy aliases for compatibility */
    --primary-blue: var(--primary);
    --primary-orange: var(--secondary);

    /* Typography */
    --font-family: 'Open Sans', sans-serif;
    --font-size-base: 16px;
    --line-height: 1.6;

    /* Spacing (8px grid) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ==========================================================================
   THEME: Classic Real Estate — backup paleta (navy + orange)
   Aktiviraj sa <html data-theme="classic"> ili <body data-theme="classic">.
   Fontovi (Cormorant Garamond + Inter Tight) i layout ostaju isti — menjaju
   se samo color tokeni. Sve canonical komponente automatski preuzimaju
   nove vrednosti jer koriste var(--*) chain.
   ========================================================================== */
:root[data-theme="classic"] {
    /* Surfaces */
    --cream:        #FFFFFF;
    --warm-white:   #FFFFFF;
    --paper:        #F5F5F5;

    /* Primary palette */
    --navy:         #1E3A5F;
    --navy-soft:    #2A4A6F;
    --terracotta:   #F47920;
    --terracotta-d: #D85E10;

    /* Type colors */
    --ink:          #333333;
    --taupe:        #666666;

    /* Lines */
    --hairline:        rgba(0, 0, 0, 0.08);
    --hairline-strong: rgba(0, 0, 0, 0.18);

    /* Success accent (used in buy-vs-rent "Kupovina na kredit") */
    --accent-success:  #28A745;

    /* Legacy aliases auto-resolve to classic values */
    --primary:        #1E3A5F;
    --primary-blue:   #1E3A5F;
    --primary-orange: #F47920;
    --secondary:      #F47920;
    --bg-light:       #F5F5F5;
    --bg-white:       #FFFFFF;
    --text-dark:      #333333;
    --text-light:     #666666;
    --border-color:   #E0E0E0;
}

/* --------------------------------------------------------------------------
   Accessibility — skip link + global focus rings
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    z-index: 2000;
    padding: 10px 18px;
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    border-radius: 4px;
    transition: top 0.18s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 12px;
    outline: 2px solid var(--terracotta);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--terracotta);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remove default focus ring on non-keyboard focus to keep mouse UX clean */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-dark);
    line-height: var(--line-height);
    background: var(--bg-white);
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* --------------------------------------------------------------------------
   Header (from Style Guide)
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    background: rgba(250, 248, 244, 0.92);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.header-inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-logo img {
    max-height: 48px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Multi-tenant logo: tenant-uploaded image fallback wordmark
   (vidi templates/frontend/base.html.twig — onerror handler). Image je
   constrain-ovan na 44px da broken-image alt text ne wrap-uje na 2 linije. */
.header-logo-image {
    max-height: 44px;
    max-width: 200px;
    width: auto;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.header-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.site-logo-icon {
    height: 44px;
    width: auto;
    flex-shrink: 0;
    display: block;
}

.header-logo-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.header-nav a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--taupe);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    position: relative;
}

.header-nav a:hover {
    color: var(--ink);
}

.header-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: var(--terracotta);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.header-nav a:hover::after {
    transform: scaleX(1);
}

/* Dropdown chevron rendered after the link text. Positioned absolutely so it
   does not push the link off the shared baseline shared with sibling nav
   items (Oglasi / Naselja / Saveti / Krediti). The link itself reserves a
   right-side gutter via padding-right. */
.nav-dropdown-group > a.has-dropdown {
    padding-right: 16px;
    position: relative;
}

.nav-dropdown-group > a.has-dropdown::before {
    content: '▾';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    opacity: 0.7;
    line-height: 1;
}

/* The sliding terracotta underline pseudo (::after on .header-nav a) still
   works because we only repurposed ::before here. */

/* Nav dropdown */
.nav-dropdown-group {
    position: relative;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.18s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown-group:hover .nav-dropdown,
.nav-dropdown-group.active .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-dark) !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
    opacity: 1 !important;
}

.nav-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary) !important;
}

.nav-dropdown-item i {
    width: 16px;
    color: var(--text-light);
    font-size: 13px;
}

.nav-dropdown-item:hover i {
    color: var(--primary);
}

.header-buttons {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.hamburger {
    display: none;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ink);
    align-items: center;
    justify-content: center;
}

/* Header buttons override — primary CTA uses the editorial terracotta
   and the outlined "Prijava" sits on cream, not on white-overlay. */
.site-header .btn-primary {
    background: var(--terracotta);
    color: var(--warm-white);
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.site-header .btn-primary:hover {
    background: var(--terracotta-d);
    filter: none;
}

.site-header .btn-outline {
    background: transparent;
    border: 1px solid var(--ink);
    color: var(--ink);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.site-header .btn-outline:hover {
    background: var(--ink);
    color: var(--cream);
}

/* Breadcrumb now lives in components/breadcrumb.css */

/* --------------------------------------------------------------------------
   Mobile Menu
   -------------------------------------------------------------------------- */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 12px 24px -8px rgba(28, 22, 18, 0.08);
    padding: var(--spacing-md) 0;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-menu a:hover {
    background: var(--paper);
}

.mobile-menu .mobile-buttons {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    border-top: 1px solid var(--hairline);
    margin-top: var(--spacing-sm);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--hairline);
    margin: var(--spacing-sm) 0;
}

.mobile-menu a i {
    width: 20px;
    margin-right: 8px;
}

/* --------------------------------------------------------------------------
   User Menu Dropdown
   -------------------------------------------------------------------------- */
.user-menu {
    position: relative;
}

/* user-menu-toggle koristi .btn .btn-outline iz components/button.css —
   ovde samo gap između avatar/name/arrow i nowrap garancija. */
.user-menu-toggle {
    gap: 8px;
    white-space: nowrap;
}

.user-avatar {
    width: 22px;
    height: 22px;
    background: var(--terracotta);
    color: var(--warm-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* color inherits from .btn-outline parent — ink default, cream on hover */
}

.user-menu-arrow {
    font-size: 9px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    /* color inherits from .btn-outline parent */
}

.user-menu.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-menu.active .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.user-menu-item:hover {
    background: var(--bg-light);
}

.user-menu-item i {
    width: 18px;
    color: var(--text-light);
    font-size: 14px;
}

.user-menu-item:hover i {
    color: var(--primary);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-menu-item-logout {
    color: #dc2626;
}

.user-menu-item-logout i {
    color: #dc2626;
}

.user-menu-item-logout:hover {
    background: #fef2f2;
}

/* Buttons now live in components/button.css */

/* --------------------------------------------------------------------------
   Search Box
   -------------------------------------------------------------------------- */
.search-box {
    display: flex;
    max-width: 640px;
    width: 100%;
    background: var(--warm-white);
    border: 1px solid var(--hairline-strong);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 12px 32px -12px rgba(28, 22, 18, 0.35);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: var(--terracotta);
    box-shadow: 0 12px 32px -12px rgba(184, 117, 92, 0.5);
}

.search-box input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink);
    outline: none;
}

.search-box input::placeholder {
    color: var(--taupe);
}

.search-box button {
    padding: 16px 28px;
    background: var(--terracotta);
    color: var(--warm-white);
    border: none;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-box button:hover {
    background: var(--terracotta-d);
    filter: none;
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.main-content {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-light);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

/* --------------------------------------------------------------------------
   Cards (from Style Guide)
   -------------------------------------------------------------------------- */
.section-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

/* .section-title now lives in components/section.css (editorial spec) */

/* --------------------------------------------------------------------------
   Neighborhood Cards
   -------------------------------------------------------------------------- */
.neighborhoods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.neighborhood-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 100px;
}

.neighborhood-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.neighborhood-image-placeholder {
    width: 100%;
    height: 100%;
    background: #e8edf2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #9aaab8;
}

.neighborhood-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 8px 10px 6px;
    color: white;
}

.neighborhood-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.neighborhood-card a {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* --------------------------------------------------------------------------
   Article List
   -------------------------------------------------------------------------- */
.article-item {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.article-item h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.article-item a {
    color: var(--secondary);
    font-size: 0.85rem;
}

.btn-more {
    display: block;
    text-align: center;
    margin-top: 15px;
}

/* --------------------------------------------------------------------------
   Ad List
   -------------------------------------------------------------------------- */
.ad-item {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.ad-item .ad-info h4 {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.ad-item .ad-info .price {
    color: var(--secondary);
    font-weight: 700;
}

.ad-item .btn-details {
    padding: 5px 15px;
    font-size: 0.8rem;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
}

.ad-item .btn-details:hover {
    background: var(--primary);
    color: white;
}

/* --------------------------------------------------------------------------
   Tips Section
   -------------------------------------------------------------------------- */
.tips-section {
    background: var(--primary);
    padding: var(--spacing-2xl) 0;
}

.tips-section .section-title {
    color: white;
    border-bottom-color: var(--secondary);
}

.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 800px;
}

.tip-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
}

.tip-card .icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.tip-card h4 {
    margin-bottom: 15px;
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Social Section
   -------------------------------------------------------------------------- */
.social-section {
    background: var(--primary);
    padding: 0 0 var(--spacing-2xl);
}

.social-section .section-title {
    color: white;
    border-bottom-color: var(--secondary);
    margin-bottom: 20px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.social-icons a:hover {
    transform: scale(1.1);
}

.social-icons .facebook { color: #1877f2; }
.social-icons .instagram { color: #e4405f; }
.social-icons .youtube { color: #ff0000; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background: var(--cream);
    padding: clamp(48px, 6vw, 80px) 0 28px;
    border-top: 1px solid var(--hairline);
    color: var(--ink);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(28px, 4vw, 56px);
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--hairline);
}

.footer-col h4 {
    margin: 0 0 18px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--taupe);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.footer-col ul li a:hover {
    color: var(--terracotta);
    border-bottom-color: var(--terracotta);
}

.footer-col ul li a i {
    color: var(--terracotta);
    margin-right: 6px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding-top: 0;
    border-top: none;
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--taupe);
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Form elements now live in components/form.css */

/* --------------------------------------------------------------------------
   Password visibility toggle
   -------------------------------------------------------------------------- */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.75rem !important;
}

.password-toggle-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    line-height: 1;
    font-size: 0.9rem;
    transition: color 0.15s ease;
    z-index: 5;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
    color: var(--primary, #1e3a5f);
    outline: none;
}

/* --------------------------------------------------------------------------
   Image Gallery
   -------------------------------------------------------------------------- */
.image-gallery {
    margin-top: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/2;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.gallery-item .gallery-overlay i {
    color: white;
    font-size: 24px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   Responsive - Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Responsive - Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .site-header {
        height: 60px;
    }

    .header-logo img {
        max-height: 36px;
        max-width: 90px;
    }

    .site-logo-icon {
        height: 34px;
    }

    .header-logo-name {
        font-size: 15px;
    }

    .header-nav,
    .header-buttons {
        display: none;
    }

    .breadcrumb-section {
        padding: 12px 0;
    }

    .breadcrumb-item {
        font-size: 0.85rem;
    }

    .hamburger {
        display: flex;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Delete Confirmation Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon.danger {
    background: #fef2f2;
    color: #dc2626;
}

.modal-icon.warning {
    background: #fffbeb;
    color: #f59e0b;
}

.modal-icon i {
    font-size: 24px;
}

.modal-header-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.modal-header-content p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

.modal-body {
    padding: 20px 24px;
}

.modal-body .delete-item-info {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-body .delete-item-info img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.modal-body .delete-item-info .info {
    flex: 1;
}

.modal-body .delete-item-info .info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.modal-body .delete-item-info .info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}

/* .btn-danger + .btn-secondary now from components/button.css */

/* --------------------------------------------------------------------------
   Card Component - Consistent Button Position
   -------------------------------------------------------------------------- */

/* Card containers should be flex columns */
.section-card,
.demo-card,
.article-card,
.ad-card {
    display: flex;
    flex-direction: column;
}

/* Content wrappers inside cards */
.section-card > .content,
.section-card > .card-body,
.demo-card > .content,
.article-card > .content,
.ad-card > .content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Push buttons to bottom when inside content wrapper */
.section-card > .content > .btn:last-child,
.section-card > .content > a.btn:last-child,
.section-card > .card-body > .btn:last-child,
.section-card > .card-body > a.btn:last-child,
.demo-card > .content > .btn:last-child,
.demo-card > .content > a.btn:last-child,
.article-card > .content > .btn:last-child,
.article-card > .content > a.btn:last-child,
.ad-card > .content > .btn:last-child,
.ad-card > .content > a.btn:last-child {
    margin-top: auto;
    align-self: flex-start;
}

/* Direct child buttons (for cards without content wrapper) */
.section-card > .btn:last-child,
.section-card > a.btn:last-child {
    margin-top: auto;
    align-self: flex-start;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 16px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
