/* Dynamic Search Pro CSS - Mobile Optimized */
:root {
    --dsp-primary: #0274be;
    --dsp-primary-dark: #02629e;
    --dsp-primary-light: #e2f0f9;
    --dsp-bg: #f5f5f5;
    --dsp-text: #3a3a3a;
    --dsp-text-light: #7a7a7a;
    --dsp-border: #e5e5e5;
    --dsp-white: #ffffff;
    --dsp-touch-target: 44px;
}

.dsp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Filter Section - Mobile First */
.dsp-filters {
    background: var(--dsp-white);
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--dsp-border);
}

.dsp-filters-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.dsp-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dsp-group label {
    font-weight: 600;
    color: var(--dsp-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsp-group label i {
    color: var(--dsp-primary);
    font-style: normal;
}

.dsp-group input,
.dsp-group select {
    padding: 12px 14px;
    border: 2px solid var(--dsp-border);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
    background: var(--dsp-white);
    width: 100%;
    box-sizing: border-box;
    min-height: var(--dsp-touch-target);
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .dsp-group input,
    .dsp-group select {
        font-size: 16px;
    }
}

.dsp-group input:focus,
.dsp-group select:focus {
    outline: none;
    border-color: var(--dsp-primary);
    box-shadow: 0 0 0 3px rgba(2,116,190,0.1);
}

.dsp-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dsp-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    min-height: var(--dsp-touch-target);
    width: 100%;
}

.dsp-btn-primary {
    background: var(--dsp-primary);
    color: white;
}

.dsp-btn-primary:active {
    background: var(--dsp-primary-dark);
    transform: scale(0.98);
}

.dsp-btn-secondary {
    background: #f0f0f0;
    color: var(--dsp-text);
}

.dsp-btn-secondary:active {
    background: #e0e0e0;
    transform: scale(0.98);
}

/* Results Stats - Mobile */
.dsp-stats {
    background: var(--dsp-primary-light);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 4px solid var(--dsp-primary);
    font-size: 14px;
    font-weight: 500;
    color: var(--dsp-primary-dark);
}

/* Post Cards - Mobile Optimized */
.dsp-post {
    background: var(--dsp-white);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--dsp-border);
    transition: all 0.3s;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dsp-post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.dsp-post-title a {
    color: var(--dsp-text);
    text-decoration: none;
}

.dsp-post-title a:active {
    color: var(--dsp-primary);
}

.dsp-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--dsp-border);
    font-size: 12px;
    color: var(--dsp-text-light);
}

.dsp-post-meta i {
    color: var(--dsp-primary);
    margin-right: 4px;
    font-style: normal;
}

.dsp-post-excerpt {
    color: var(--dsp-text-light);
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 14px;
}

.dsp-cat-badge {
    display: inline-block;
    background: var(--dsp-primary-light);
    color: var(--dsp-primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    margin-right: 6px;
    margin-bottom: 6px;
    text-decoration: none;
    min-height: 30px;
    line-height: 1.2;
}

.dsp-cat-badge:active {
    background: var(--dsp-primary);
    color: white;
}

/* Pagination - Mobile Friendly */
.dsp-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.dsp-page {
    padding: 10px 14px;
    background: var(--dsp-white);
    border: 2px solid var(--dsp-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dsp-page:active {
    background: var(--dsp-primary-light);
    border-color: var(--dsp-primary);
    transform: scale(0.96);
}

.dsp-page.active {
    background: var(--dsp-primary);
    border-color: var(--dsp-primary);
    color: white;
}

/* Loading State */
.dsp-loading {
    text-align: center;
    padding: 40px 20px;
}

.dsp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dsp-border);
    border-top-color: var(--dsp-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.dsp-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--dsp-white);
    border-radius: 12px;
    border: 1px solid var(--dsp-border);
}

/* ============================================
   TABLET & DESKTOP MEDIA QUERIES
   ============================================ */

/* Tablet (768px and up) */
@media screen and (min-width: 768px) {
    .dsp-container {
        padding: 30px 20px;
    }
    
    .dsp-filters {
        padding: 25px;
        margin-bottom: 30px;
    }
    
    .dsp-filters-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .dsp-buttons {
        flex-direction: row;
        gap: 15px;
    }
    
    .dsp-btn {
        width: auto;
        padding: 12px 28px;
    }
    
    .dsp-post {
        padding: 25px;
        margin-bottom: 20px;
    }
    
    .dsp-post-title {
        font-size: 20px;
    }
    
    .dsp-post-meta {
        gap: 20px;
        font-size: 13px;
    }
    
    .dsp-stats {
        padding: 12px 20px;
        margin-bottom: 20px;
    }
    
    .dsp-pagination {
        gap: 8px;
    }
    
    .dsp-page {
        padding: 8px 16px;
        min-width: 40px;
    }
}

/* Desktop (1024px and up) */
@media screen and (min-width: 1024px) {
    .dsp-filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop (1200px and up) */
@media screen and (min-width: 1200px) {
    .dsp-filters-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   MOBILE SPECIFIC ENHANCEMENTS
   ============================================ */

/* Better touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    .dsp-btn,
    .dsp-page,
    .dsp-cat-badge,
    .dsp-post-title a {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(2,116,190,0.2);
    }
    
    .dsp-group select {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%230274be" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
        background-repeat: no-repeat;
        background-position: right 12px center;
        appearance: none;
        padding-right: 36px;
    }
}

/* Small phones (up to 480px) */
@media screen and (max-width: 480px) {
    .dsp-container {
        padding: 15px 12px;
    }
    
    .dsp-filters {
        padding: 16px 12px;
        border-radius: 10px;
    }
    
    .dsp-filters-grid {
        gap: 12px;
    }
    
    .dsp-group input,
    .dsp-group select {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .dsp-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .dsp-post {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .dsp-post-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .dsp-post-meta {
        gap: 8px;
        font-size: 11px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .dsp-post-excerpt {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .dsp-cat-badge {
        padding: 4px 10px;
        font-size: 10px;
        min-height: 28px;
    }
    
    .dsp-stats {
        font-size: 12px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .dsp-pagination {
        gap: 5px;
        margin-top: 20px;
    }
    
    .dsp-page {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .dsp-loading {
        padding: 30px 15px;
    }
    
    .dsp-spinner {
        width: 35px;
        height: 35px;
    }
    
    .dsp-no-results {
        padding: 30px 15px;
        font-size: 14px;
    }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .dsp-filters-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .dsp-buttons {
        flex-direction: row;
    }
    
    .dsp-container {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --dsp-bg: #1a1a2e;
        --dsp-text: #eeeeee;
        --dsp-text-light: #aaaaaa;
        --dsp-border: #333344;
        --dsp-white: #16213e;
    }
    
    .dsp-post,
    .dsp-filters,
    .dsp-no-results {
        border-color: #333344;
    }
    
    .dsp-btn-secondary {
        background: #2a2a3e;
        color: #eeeeee;
    }
    
    .dsp-btn-secondary:active {
        background: #3a3a4e;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .dsp-post,
    .dsp-page,
    .dsp-btn {
        animation: none;
        transition: none;
    }
    
    .dsp-spinner {
        animation: none;
        border: 3px solid var(--dsp-primary);
        border-right-color: var(--dsp-border);
    }
    
    .dsp-page:active,
    .dsp-btn:active {
        transform: none;
    }
}

/* Print styles */
@media print {
    .dsp-filters,
    .dsp-pagination,
    .dsp-btn {
        display: none;
    }
    
    .dsp-post {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}