/**
 * Idebank Grid Styles
 * Compatible with UIkit / YooTheme
 */

/* ==========================================================================
   Variables - Match Landmandsdrevet theme colors
   ========================================================================== */
:root {
    --idebank-primary: #003d73;
    --idebank-primary-hover: #002d56;
    --idebank-text: #333333;
    --idebank-text-muted: #666666;
    --idebank-border: #e5e5e5;
    --idebank-background: #f8f8f8;
    --idebank-white: #ffffff;
    --idebank-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --idebank-shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.12);
    --idebank-transition: all 0.3s ease;
}

/* ==========================================================================
   Wrapper
   ========================================================================== */
.idebank-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.idebank-search-bar {
    max-width: 600px;
    margin: 0 auto 30px;
}

.idebank-search-bar .uk-search-input {
    height: 50px;
    padding: 0 50px 0 20px;
    font-size: 16px;
    border: 2px solid var(--idebank-border);
    border-radius: 8px;
    background: var(--idebank-white);
    transition: var(--idebank-transition);
}

.idebank-search-bar .uk-search-input:focus {
    border-color: var(--idebank-primary);
    outline: none;
}

.idebank-search-bar .uk-search-icon-flip {
    right: 15px;
    color: var(--idebank-text-muted);
}

/* ==========================================================================
   Filter Buttons
   ========================================================================== */
.idebank-filter-buttons {
    gap: 15px;
    justify-content: center;
}

.idebank-filter-dropdown {
    margin: 5px;
}

.idebank-filter-btn {
    min-width: 140px;
    height: 45px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--idebank-text);
    background: var(--idebank-white);
    border: 2px solid var(--idebank-primary);
    border-radius: 6px;
    transition: var(--idebank-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    vertical-align: middle;
}

.idebank-filter-btn:hover,
.idebank-filter-btn:focus,
.idebank-filter-btn.active {
    background: var(--idebank-primary);
    color: var(--idebank-white);
    border-color: var(--idebank-primary);
}

.idebank-filter-btn .filter-label {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.idebank-filter-btn span[uk-icon] {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Dropdown Styling */
.idebank-filter-dropdown .uk-dropdown {
    min-width: 200px;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: var(--idebank-shadow-hover);
    border: 1px solid var(--idebank-border);
}

.idebank-filter-dropdown .uk-dropdown-nav > li > a {
    padding: 10px 20px;
    color: var(--idebank-text);
    transition: var(--idebank-transition);
}

.idebank-filter-dropdown .uk-dropdown-nav > li > a:hover,
.idebank-filter-dropdown .uk-dropdown-nav > li.uk-active > a {
    background: var(--idebank-primary);
    color: var(--idebank-white);
}

/* ==========================================================================
   Active Filters
   ========================================================================== */
.idebank-active-filters {
    gap: 10px;
    min-height: 32px;
}

.idebank-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--idebank-primary);
    color: var(--idebank-white);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.idebank-active-filter .remove-filter {
    cursor: pointer;
    opacity: 0.8;
    transition: var(--idebank-transition);
}

.idebank-active-filter .remove-filter:hover {
    opacity: 1;
}

.idebank-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: var(--idebank-text-muted);
    border: 1px solid var(--idebank-border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--idebank-transition);
}

.idebank-clear-all:hover {
    background: var(--idebank-background);
    color: var(--idebank-text);
}

/* ==========================================================================
   Results Info
   ========================================================================== */
.idebank-results-info {
    font-size: 14px;
    color: var(--idebank-text-muted);
}

/* ==========================================================================
   Grid
   ========================================================================== */
.idebank-grid {
    margin-top: 30px;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.idebank-card-wrapper {
    margin-bottom: 30px;
}

.idebank-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--idebank-white);
    box-shadow: var(--idebank-shadow);
    transition: var(--idebank-transition);
}

.idebank-card:hover {
    box-shadow: var(--idebank-shadow-hover);
    transform: translateY(-3px);
}

/* Card Image */
.idebank-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--idebank-background);
}

.idebank-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--idebank-transition);
}

.idebank-card:hover .idebank-card-image img {
    transform: scale(1.05);
}

.idebank-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--idebank-background) 0%, #e0e0e0 100%);
    color: var(--idebank-border);
}

/* Card Content */
.idebank-card-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.idebank-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--idebank-text);
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idebank-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--idebank-text-muted);
    margin: 0;
    flex: 1;
}

/* Card Footer */
.idebank-card-footer {
    padding: 15px 25px 25px;
    border-top: none;
}

.idebank-read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--idebank-primary);
    text-transform: none;
    transition: var(--idebank-transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.idebank-read-more:hover {
    color: var(--idebank-primary-hover);
    text-decoration: none;
}

.idebank-read-more span[uk-icon] {
    transition: transform 0.3s ease;
}

.idebank-read-more:hover span[uk-icon] {
    transform: translateX(3px);
}

/* ==========================================================================
   Load More Button
   ========================================================================== */
.idebank-load-more-wrapper {
    margin-top: 40px;
}

.idebank-load-more {
    min-width: 200px;
    height: 50px;
    padding: 0 35px;
    font-size: 16px;
    font-weight: 600;
    background: var(--idebank-primary);
    color: var(--idebank-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--idebank-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.idebank-load-more:hover {
    background: var(--idebank-primary-hover);
    transform: translateY(-2px);
}

.idebank-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.idebank-load-more .load-more-spinner {
    margin-left: 5px;
}

/* ==========================================================================
   No Results
   ========================================================================== */
.idebank-no-results {
    padding: 60px 20px;
    background: var(--idebank-background);
    border-radius: 12px;
    margin-top: 30px;
}

.idebank-no-results h3 {
    color: var(--idebank-text);
    margin: 20px 0 10px;
}

.idebank-no-results p {
    color: var(--idebank-text-muted);
    margin: 0;
}

.idebank-no-results span[uk-icon] {
    color: var(--idebank-border);
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.idebank-grid.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.idebank-grid-wrapper .uk-spinner {
    color: var(--idebank-primary);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes idebankFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.idebank-card-wrapper {
    animation: idebankFadeIn 0.4s ease forwards;
}

.idebank-card-wrapper:nth-child(1) { animation-delay: 0.05s; }
.idebank-card-wrapper:nth-child(2) { animation-delay: 0.1s; }
.idebank-card-wrapper:nth-child(3) { animation-delay: 0.15s; }
.idebank-card-wrapper:nth-child(4) { animation-delay: 0.2s; }
.idebank-card-wrapper:nth-child(5) { animation-delay: 0.25s; }
.idebank-card-wrapper:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 959px) {
    .idebank-grid-wrapper {
        padding: 30px 15px;
    }

    .idebank-card-image {
        height: 180px;
    }

    .idebank-filter-btn {
        min-width: 120px;
        font-size: 14px;
    }
}

@media (max-width: 639px) {
    .idebank-filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .idebank-filter-dropdown {
        width: 100%;
    }

    .idebank-filter-btn {
        width: 100%;
        justify-content: space-between;
    }

    .idebank-card-content {
        padding: 20px;
    }

    .idebank-card-footer {
        padding: 12px 20px 20px;
    }

    .idebank-card-title {
        font-size: 16px;
    }

    .idebank-card-image {
        height: 160px;
    }
}

/* ==========================================================================
   UIkit Overrides for YooTheme Compatibility
   ========================================================================== */
.idebank-grid-wrapper .uk-card-default {
    background: var(--idebank-white);
    box-shadow: var(--idebank-shadow);
}

.idebank-grid-wrapper .uk-card-hover:hover {
    box-shadow: var(--idebank-shadow-hover);
}

.idebank-grid-wrapper .uk-button-primary {
    background: var(--idebank-primary);
    border-color: var(--idebank-primary);
}

.idebank-grid-wrapper .uk-button-primary:hover {
    background: var(--idebank-primary-hover);
    border-color: var(--idebank-primary-hover);
}

.idebank-grid-wrapper .uk-button-text {
    color: var(--idebank-primary);
}

.idebank-grid-wrapper .uk-button-text:hover {
    color: var(--idebank-primary-hover);
}
