/**
 * Projects Page Styles
 * หน้ารายการโครงการทั้งหมด
 */

:root {
    --primary-blue: #1e40af;
    --dark-blue: #1e3a8a;
}

/* Header */
.projects-header {
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
    padding: 113px 0 30px 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.projects-header h1 {
    font-size: 3rem;
    font-weight: 700;
}

.projects-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Container */
.projects-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    background: var(--bg-gray);
}

/* Page Path */
.page-path {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.page-path a {
    display: inline-flex;
    align-items: center;
    color: var(--gray);
    text-decoration: none;
}

.page-path a i {
    color: var(--primary-blue);
    font-size: 1rem;
}

.page-path > span {
    color: var(--gray);
    font-size: 0.9rem;
}

.page-path .current {
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Search and Filter Container */
.search-filter-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #1e3ea5;
    border-radius: 0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input::placeholder {
    color: #1e3ea5;
    font-weight: 500;
}

.search-box input:focus {
    border-color: var(--primary-blue);
}

/* Category Filter */
.category-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.category-label {
    padding: 10px 20px;
    border: 2px solid #1e3d9d;
    color: #1e3d9d;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* No Projects */
.no-projects {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .projects-header h1 {
        font-size: 2rem;
    }

    .search-box {
        max-width: 100%;
    }

    .category-filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-filter {
        width: 100%;
    }
}

/* View All Button - สำหรับหน้า index.php */
.view-all-container {
    text-align: center;
    margin-top: 40px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.view-all-btn i {
    transition: transform 0.3s ease;
}

.view-all-btn:hover i {
    transform: translateX(5px);
}

/* Loading State */
.projects-grid.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.projects-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Result Count */
.result-count {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    padding: 10px 0;
}

/* No Results Message */
.no-results-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--gray);
}

.no-results-message p {
    margin: 5px 0;
    font-size: 1rem;
}

/* Load More Button */
.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin: 30px auto;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Prompt', sans-serif;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.load-more-btn i {
    font-size: 0.9rem;
}

/* Search Box Icon */
.search-box {
    position: relative;
}

.search-box::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-box input {
    padding-left: 45px;
}
