/* WP İlan Ver - Premium Styles */

:root {
    --wpilan-primary: #43b02a;
    --wpilan-primary-hover: #369121;
    --wpilan-secondary: #2c3e50;
    --wpilan-bg: #f8f9fa;
    --wpilan-border: #e9ecef;
    --wpilan-text: #212529;
    --wpilan-text-muted: #6c757d;
}

.wpilan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Sidebar */
.wpilan-sidebar {
    width: 250px;
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .wpilan-sidebar {
        display: none;
        /* Mobile toggle logic handled by JS class 'active' */
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        background: #fff;
        z-index: 1050;
        padding: 20px;
        overflow-y: auto;
    }

    .wpilan-sidebar.active {
        display: block;
    }
}

.wpilan-filter-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--wpilan-border);
}

.wpilan-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--wpilan-border);
    padding-bottom: 10px;
}

.wpilan-filter-group {
    margin-bottom: 20px;
}

.wpilan-filter-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--wpilan-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpilan-filter-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    /* Limit height */
    overflow-y: auto;
    /* Enable scroll */
    padding-right: 5px;
    /* Space for scrollbar */
    padding: 10px;
    border: 1px solid #f1f1f1;
    border-radius: 8px;
    background: #fdfdfd;
}

/* Custom Scrollbar for Filters */
.wpilan-filter-content::-webkit-scrollbar {
    width: 5px;
}

.wpilan-filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wpilan-filter-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.wpilan-filter-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.wpilan-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--wpilan-text);
    cursor: pointer;
}

.wpilan-filter-btn {
    width: 100%;
    background: var(--wpilan-primary);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wpilan-filter-btn:hover {
    background: var(--wpilan-primary-hover);
}

.wpilan-clear-btn {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: var(--wpilan-text-muted);
    text-decoration: none;
}

/* Listings Grid */
.wpilan-listings {
    flex: 1;
}

.wpilan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Card Design */
.wpilan-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--wpilan-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.wpilan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.wpilan-badge-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.wpilan-featured-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ffd700, #ffb900);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpilan-card-img-link {
    display: block;
    position: relative;
    padding-top: 100%;
    /* Square Aspect Ratio for generic content */
    overflow: hidden;
    background: #f8f9fa;
    /* Light gray background to show full image if contain is used */
}

.wpilan-card-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    transition: transform 0.5s;
}

.wpilan-card:hover .wpilan-card-img {
    transform: translate(-50%, -50%) scale(1.05);
}

.wpilan-card-no-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ccc;
    background: #f8f9fa;
}

.wpilan-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wpilan-card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    height: 44px;
    /* Limit to 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wpilan-card-title a {
    color: var(--wpilan-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.wpilan-card-title a:hover {
    color: var(--wpilan-primary);
}

.wpilan-card-specs {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #000000;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.wpilan-card-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.wpilan-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--wpilan-border);
    padding-top: 12px;
}

.wpilan-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--wpilan-primary);
}

.wpilan-btn-detail {
    font-size: 13px;
    font-weight: 600;
    color: var(--wpilan-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.wpilan-btn-detail:hover {
    color: var(--wpilan-primary);
}

/* Form Styles */
.wpilan-form-container {
    background: #fff;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
    border: 3px solid var(--wpilan-border);
}

.wpilan-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.wpilan-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .wpilan-form-row {
        flex-direction: column;
        gap: 15px;
    }
}

.wpilan-form-group {
    flex: 1;
    margin-bottom: 0;
}

.wpilan-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--wpilan-text);
}

.wpilan-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.wpilan-form-control:focus {
    border-color: var(--wpilan-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 176, 42, 0.1);
}

.wpilan-submit-btn {
    background: var(--wpilan-primary);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(67, 176, 42, 0.3);
}

.wpilan-submit-btn:hover {
    background: var(--wpilan-primary-hover);
    transform: translateY(-2px);
}

/* Upload Area */
.wpilan-upload-area:hover {
    border-color: var(--wpilan-primary) !important;
    background: #f0fdf4 !important;
}

/* 
=============================================
   THEME OVERRIDES - FORCE PLUGIN STYLES
============================================= 
*/

/* Force Button Colors */
.wpilan-container .btn-primary,
.wpilan-single-container .btn-primary,
.modal .btn-primary,
.wpilan-submit-btn,
.wpilan-filter-btn {
    background-color: #43b02a !important;
    border-color: #43b02a !important;
    color: #fff !important;
}

.wpilan-container .btn-primary:hover,
.wpilan-single-container .btn-primary:hover,
.modal .btn-primary:hover,
.wpilan-submit-btn:hover,
.wpilan-filter-btn:hover {
    background-color: #369121 !important;
    border-color: #369121 !important;
    color: #fff !important;
}

.wpilan-container .btn-success,
.wpilan-single-container .btn-success {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: #fff !important;
}

.wpilan-container .btn-danger,
.wpilan-single-container .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

/* Force Text Colors */
.wpilan-price {
    color: #43b02a !important;
}

/* Fix for some themes overriding form controls */
.wpilan-form-control:focus {
    border-color: #43b02a !important;
    box-shadow: 0 0 0 3px rgba(67, 176, 42, 0.1) !important;
}

/* Mobile 2-Column Grid & Minimal Cards */
@media (max-width: 768px) {
    .wpilan-listings .wpilan-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Minimal Card Styles for Mobile */
    .wpilan-card {
        border-radius: 8px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 0 !important;
    }

    .wpilan-card-img-link {
        padding-top: 100%;
        /* Square image */
    }

    .wpilan-card-body {
        padding: 10px !important;
    }

    .wpilan-card-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
        height: 34px !important;
        /* Limit to roughly 2 lines */
        margin-bottom: 6px !important;
        overflow: hidden;
    }

    .wpilan-card-specs {
        display: none !important;
        /* Hide specs on mobile for minimal look */
    }

    .wpilan-card-footer {
        padding-top: 8px !important;
        margin-top: 0 !important;
    }

    .wpilan-price {
        font-size: 14px !important;
    }

    .wpilan-btn-detail {
        display: inline-flex !important;
        font-size: 11px !important;
        padding: 4px 8px !important;
        background: #f8f9fa;
        border-radius: 4px;
        white-space: nowrap;
    }

    /* Featured Badge Adjustment */
    .wpilan-featured-label {
        font-size: 9px !important;
        padding: 2px 6px !important;
        top: 5px !important;
        left: 5px !important;
    }

    .wpilan-badge-view {
        font-size: 9px !important;
        padding: 2px 6px !important;
        top: 5px !important;
        right: 5px !important;
    }
}