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

/* --------------------------------------------------------------------------
   CSS Variables (from Style Guide)
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --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;
}

/* --------------------------------------------------------------------------
   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: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 72px;
    background: transparent;
}

.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;
}

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

.header-logo-name {
    font-size: 17px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

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

.header-nav a {
    font-size: 15px;
    font-weight: 500;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-nav a:hover {
    opacity: 0.8;
}

.nav-dropdown-group > a.has-dropdown::after {
    content: " ▾";
    font-size: 10px;
    opacity: 0.7;
}

/* 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;
}

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

/* --------------------------------------------------------------------------
   Breadcrumb Navigation
   -------------------------------------------------------------------------- */
.breadcrumb-section {
    background: var(--bg-white);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-sm);
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--secondary);
}

.breadcrumb-item.active {
    color: var(--text-light);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    padding: 0 var(--spacing-sm);
    color: var(--text-light);
}

/* --------------------------------------------------------------------------
   Mobile Menu
   -------------------------------------------------------------------------- */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 58, 95, 0.98);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    padding: var(--spacing-md) 0;
}

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

.mobile-menu a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 15px;
    font-weight: 500;
    color: white;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

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

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

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

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-menu.active .user-menu-toggle {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.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 (from Style Guide)
   -------------------------------------------------------------------------- */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

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

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

.btn-outline-dark {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-outline-light {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Search Box
   -------------------------------------------------------------------------- */
.search-box {
    display: flex;
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.search-box button {
    padding: 15px 30px;
    background: var(--secondary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    filter: brightness(0.9);
}

/* --------------------------------------------------------------------------
   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 {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
}

/* --------------------------------------------------------------------------
   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: #f8f8f8;
    padding: var(--spacing-2xl) 0 20px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1rem;
}

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

.footer-col ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-col ul li a {
    color: var(--text-light);
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Form Elements (from Style Guide)
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

/* --------------------------------------------------------------------------
   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 {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

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

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

/* --------------------------------------------------------------------------
   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%;
    }
}
