/**
 * board_term/css/list.css
 * Term Dictionary List Page Styles
 * Mobile First + Single Breakpoint (768px)
 * 
 * Note: Common styles (buttons, forms, pagination) 
 *       are defined in /css/board_common.css
 */

/* ============================================
   Term Dictionary Header
   ============================================ */
.term-dict-header {
    text-align: center;
    margin: 1.5rem 0 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.term-dict-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.term-dict-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.term-dict-subtitle strong {
    color: #ffd700;
    font-size: 1.2rem;
}

/* ============================================
   Search Section
   ============================================ */
.search-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.search-form-main {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-input-main {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.search-input-main:focus {
    outline: none;
    border-color: #667eea;
}

.search-button-main {
    width: 100%;
    padding: 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
}

.search-button-main:hover {
    background: #5568d3;
}

.search-tips {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ============================================
   Autocomplete Results
   ============================================ */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-ko {
    font-weight: bold;
    color: #333;
    margin-right: 0.5rem;
}

.autocomplete-en {
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   Recent Search Dropdown
   ============================================ */
.recent-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

.recent-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
}

.recent-clear-all {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    transition: color 0.3s;
}

.recent-clear-all:hover {
    color: #c82333;
    text-decoration: underline;
}

.recent-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.recent-search-item:last-child {
    border-bottom: none;
}

.recent-search-item:hover {
    background: #f0f0f0;
}

.recent-keyword {
    flex: 1;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
}

.recent-keyword:hover {
    color: #667eea;
}

.recent-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    transition: color 0.3s;
    line-height: 1;
}

.recent-remove:hover {
    color: #dc3545;
}

/* ============================================
   Index Section (Chosung / Alphabet)
   ============================================ */
.index-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.index-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
}

.index-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.index-btn {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.index-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* ============================================
   Recent Terms Section
   ============================================ */
.recent-terms-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.recent-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
}

.recent-terms-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-term-item {
    border-bottom: 1px solid #eee;
}

.recent-term-item:last-child {
    border-bottom: none;
}

.recent-term-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0;
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.recent-term-link:hover {
    color: #667eea;
}

.recent-term-link:hover .recent-term-ko {
    color: #667eea;
}

.recent-term-ko {
    font-weight: bold;
    font-size: 1rem;
}

.recent-term-en {
    color: #666;
    font-size: 0.9rem;
}

.recent-term-date {
    margin-left: auto;
    color: #999;
    font-size: 0.8rem;
}

.no-terms {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* ============================================
   Admin Actions
   ============================================ */
.admin-actions {
    text-align: center;
    margin: 1.5rem 0;
}

.btn-write {
    display: inline-block;
    padding: 1rem 2rem;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-write:hover {
    background: #218838;
}

/* Admin Link Section */
.admin-link-section {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-admin-manage {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-admin-manage:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.btn-admin-manage i {
    margin-right: 0.5rem;
}

/* ============================================
   Desktop Styles (min-width: 768px)
   ============================================ */
@media (min-width: 768px) {

    /* Term Dictionary Header */
    .term-dict-header {
        margin: 2rem 0 3rem 0;
        padding: 2rem;
    }

    .term-dict-title {
        font-size: 2rem;
    }

    .term-dict-subtitle {
        font-size: 1.1rem;
    }

    .term-dict-subtitle strong {
        font-size: 1.3rem;
    }

    /* Search Section */
    .search-section {
        margin: 2rem 0;
        padding: 2rem;
    }

    .search-input-wrapper {
        flex-direction: row;
    }

    .search-input-main {
        flex: 1;
        font-size: 1.1rem;
    }

    .search-button-main {
        width: auto;
        padding: 1rem 2rem;
    }

    .search-tips {
        font-size: 0.9rem;
    }

    /* Autocomplete */
    .autocomplete-results {
        max-height: 300px;
    }

    /* Recent Search */
    .recent-search-dropdown {
        max-height: 300px;
    }

    .recent-search-item {
        padding: 0.8rem 1rem;
    }

    /* Index Section */
    .index-section {
        margin: 2rem 0;
        padding: 1.5rem;
    }

    .index-title {
        font-size: 1.3rem;
    }

    .index-buttons {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .index-btn {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }

    /* Recent Terms */
    .recent-terms-section {
        margin: 2rem 0;
        padding: 1.5rem;
    }

    .recent-title {
        font-size: 1.3rem;
    }

    .recent-term-ko {
        font-size: 1.05rem;
    }

    .recent-term-en {
        font-size: 0.95rem;
    }

    .recent-term-date {
        font-size: 0.85rem;
    }

    /* Admin Section */
    .admin-actions {
        margin: 2rem 0;
    }

    .admin-link-section {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        margin: 3rem 0 2rem 0;
        padding: 1.5rem;
    }

    .btn-admin-manage {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}