/* Modern Search Form CSS - Premium Redesign */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.4);
    --bg-dark: #0f172a;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-main: #334155;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --accent-orange: #f59e0b;
    --accent-green: #10b981;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.dark-glass {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.search-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.search-fieldset {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    background: #f0f0f0;
}

.search-legend {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    display: block;
    width: 100%;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.search-col {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.search-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.search-input,
.search-select,
.category-select {
    padding: 10px 12px;
    border: 1px solid #aaa;
    background-color: #f7f7f7;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s;
    color: #333;
}

.search-input:hover,
.search-select:hover,
.category-select:hover {
    border-color: #888;
    background-color: #fff;
}

.search-input:focus,
.search-select:focus,
.category-select:focus {
    border-color: #3394e6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(51, 148, 230, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.checkbox-wrapper input[type="checkbox"],
.checkbox-wrapper input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.checkbox-wrapper label {
    cursor: pointer;
    font-size: 0.9em;
    color: #444;
}

.search-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Segmented Control for View Options (Separated Buttons) */
.view-toggle {
    display: inline-flex;
    gap: 12px;
    margin-top: 8px;
    width: auto;
}

.view-toggle input[type="radio"] {
    display: none;
}

.view-toggle label {
    padding: 10px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.view-toggle input[type="radio"]:checked+label {
    background: #3394e6;
    color: white;
    border-color: #257bc4;
    box-shadow: 0 4px 12px rgba(51, 148, 230, 0.4);
}

.view-toggle label:hover:not(:checked) {
    background: #ebebeb;
    border-color: #ccc;
    color: #333;
}

.btn-search,
.btn-reset,
.btn-clear {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    transition: background 0.3s, transform 0.1s;
}

.btn-search {
    background-color: #3394e6;
    color: white;
}

.btn-search:hover {
    background-color: #257bc4;
}

.btn-reset,
.btn-clear {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-reset:hover,
.btn-clear:hover {
    background-color: #e9e9e9;
    color: #333;
}

.full-width {
    width: 100%;
}

.category-select {
    height: 150px !important;
}

@media (max-width: 600px) {
    .search-row {
        flex-direction: column;
        gap: 10px;
    }

    .search-actions {
        flex-direction: column;
    }

    .btn-search,
    .btn-reset,
    .btn-clear {
        width: 100%;
    }
}

/* Search Results (Modern Cards) */
.search-result-item {
    background: white;
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2f6;
    border-left: 4px solid #cbd5e1;
    transition: var(--transition-smooth);
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary);
    background: #fdfdfe;
}

.search-result-item .title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 800;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.search-result-item .title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.search-result-item:hover .title a {
    color: var(--primary);
}

.search-result-item .text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges Base */
.year-badge,
.quality-badge,
.lang-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.year-badge {
    background: #f1f5f9;
    color: #475569;
}

.quality-badge {
    background: #ecfdf5;
    color: #059669;
}

.lang-badge {
    background: #fffbeb;
    color: #d97706;
}

.search-result-item:hover .year-badge {
    background: var(--primary);
    color: white;
}

/* Meta Info */
.search-result-item .meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
}

.search-result-item .meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-result-item .meta a {
    color: var(--primary);
    text-decoration: none;
}

.search-result-item .meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.search-result-item .edit_btn i {
    font-style: normal;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* Simple Search Enhancements */
.simple-search-container {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    background: radial-gradient(circle at center, #ffffff 0%, #f8faff 100%);
    border-radius: 12px;
}

.simple-search-box {
    width: 100%;
    max-width: 650px;
    text-align: center;
}

.simple-search-title {
    font-size: 2.2em;
    font-weight: 800;
    color: #1a2a4a;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

.simple-search-input-wrapper {
    display: flex;
    background: #ffffff;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(51, 148, 230, 0.15);
    border: 1px solid #e1e8f0;
    transition: all 0.3s ease;
}

.simple-search-input-wrapper:focus-within {
    box-shadow: 0 15px 50px rgba(51, 148, 230, 0.25);
    border-color: #3394e6;
    transform: translateY(-2px);
}

.simple-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0 25px !important;
    font-size: 1.1em !important;
    height: 54px !important;
    color: #1a2a4a !important;
    outline: none !important;
    box-shadow: none !important;
}

.simple-search-input::placeholder {
    color: #a0aec0;
}

.simple-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0 45px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.simple-search-btn:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.simple-search-btn:active {
    transform: scale(0.98);
}

.simple-search-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.simple-search-footer {
    margin-top: 25px;
}

.advanced-search-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1em;
    padding: 14px 40px;
    border-radius: 50px;
    background: #1a2a4a;
    /* Deep elegant navy */
    border: 3px solid #2563eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(26, 42, 74, 0.3);
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.advanced-search-link:hover {
    color: #ffffff;
    background: #2563eb;
    border-color: #3b82f6;
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
    transform: translateY(-3px) scale(1.02);
}

.advanced-search-link svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 600px) {
    .simple-search-input-wrapper {
        flex-direction: column;
        border-radius: 15px;
        padding: 10px;
    }

    .simple-search-btn {
        width: 100%;
        height: 50px;
        margin-top: 10px;
    }

    .simple-search-title {
        font-size: 1.8em;
    }
}