/* Themes Page Styles */

.themes-page-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.page-title p {
    font-size: 1.1rem;
    color: #666;
}

/* Filters */
.themes-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
    justify-content: center;
    padding: 0 1rem;
    align-items: center;
}

.themes-filters .button {
    padding: 0 .8rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    height: 42px;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.themes-filters .button:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Select2 Customization for Themes Page */
.themes-filters .select2-container--default .select2-selection--single {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    height: 42px;
    display: flex;
    align-items: center;
    background-color: #fff;
    transition: border-color 0.3s;
}

.themes-filters .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color);
}

.themes-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 15px;
    color: #333;
    font-size: 0.9rem;
}

.themes-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 5px;
}

.themes-filters .select2-container {
    min-width: 180px;
    margin-bottom: 0;
}

.themes-filters .select2-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.themes-filters .select2-results__option {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.themes-filters .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--primary-color);
    color: white;
}

.themes-filters .select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.themes-filters .select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--accent-color);
}

/* Theme Link Styling */
.theme-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.theme-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* DataTables Container */

/* DataTables Customization */
#themes-table {
    border-collapse: collapse;
}

#themes-table thead th {
    background: #f5f5f5;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e91e63;
}

#themes-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

#themes-table tbody tr:hover {
    background: #f9f9f9;
}

/* DataTables Controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_length select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 5px;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 15px;
    color: #666;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 12px;
    margin: 5px 2px;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    color: #333;
	transition: all 0.3s ease;
	border: 1px solid #ddd;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #fff;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent-color);
    color: white!important;
    border-color: var(--accent-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

div.dataTables_processing>div:last-child>div {
	background-color: var(--accent-color);
}

@keyframes dataTables-dot-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .themes-page-main {
        max-width: 100%;
        box-sizing: border-box;
        padding: 20px 10px;
    }
    
    /* Filters 在手機版垂直排列 */
    .themes-filters {
        flex-direction: column;
        max-width: 100%;
        box-sizing: border-box;
        gap: 10px;
        padding: 0;
        justify-content: flex-start;
    }
    
    .themes-filters > * {
        flex: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .themes-filters .select2-container {
        width: 100% !important;
        min-width: 100%;
    }
    
    .themes-filters #reset-filters {
        width: 100%;
		justify-content: center;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    .themes-table-container {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 只讓 table 本身可以滾動 */
    .dataTables_wrapper .dataTables_scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 確保控制項不會滾動 */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        overflow-x: visible;
    }
    
    #themes-table {
        min-width: 600px;
    }
}
