/**
 * Staffbase Public Styles
 * Mobile-First Responsive Design
 */

/* CSS Variables */
:root {
    --staffbase-primary: #086C3A;
    --staffbase-secondary: #9e5938;
    --staffbase-text: #333;
    --staffbase-text-light: #666;
    --staffbase-border: #ddd;
    --staffbase-bg: #fff;
    --staffbase-bg-light: #f8f9fa;
    --staffbase-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --staffbase-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --staffbase-transition: 0.3s ease;
}

/* ===================================
   SINGLE STAFF PROFILE
   =================================== */

.staffbase-single {
    padding: 1rem;
}

.staffbase-profile {
    max-width: 800px;
    margin: 0 auto;
    background: var(--staffbase-bg);
}

.staffbase-profile-header {
    text-align: center;
    padding: 2rem 0;
}

.staffbase-profile-image {
    margin-bottom: 1.5rem;
}

.staff-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--staffbase-primary);
    box-shadow: var(--staffbase-shadow);
}

.staffbase-profile-title h1 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--staffbase-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.staff-positions {
    color: var(--staffbase-text-light);
    font-size: 1rem;
    margin: 0.5rem 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.staff-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.staff-status.status-active {
    background: #d4edda;
    color: #155724;
}

.staff-status.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.staffbase-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--staffbase-bg-light);
    border-radius: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

.staffbase-section h2 {
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    color: var(--staffbase-primary);
    border-bottom: 2px solid var(--staffbase-secondary);
    padding-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.staffbase-section p {
    margin: 0.5rem 0;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.staffbase-section strong {
    color: var(--staffbase-text);
}

.staffbase-section a {
    color: var(--staffbase-primary);
    text-decoration: none;
    transition: var(--staffbase-transition);
}

.staffbase-section a:hover {
    color: var(--staffbase-secondary);
    text-decoration: underline;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--staffbase-primary);
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    transition: var(--staffbase-transition);
    font-size: 0.9rem;
}

.social-link:hover {
    background: var(--staffbase-secondary);
    transform: translateY(-2px);
    box-shadow: var(--staffbase-shadow);
}

.button-cv {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--staffbase-secondary);
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--staffbase-transition);
}

.button-cv:hover {
    background: var(--staffbase-primary);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--staffbase-shadow-hover);
}

/* ===================================
   ARCHIVE PAGE
   =================================== */

.staffbase-archive {
    padding: 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--staffbase-border);
}

.page-title {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: var(--staffbase-text);
}

.archive-description {
    color: var(--staffbase-text-light);
    margin: 0;
}

/* Search and Filters */
.staffbase-controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.staffbase-search-form {
    width: 100%;
}

.search-field-wrapper {
    display: flex;
    gap: 0.5rem;
}

.staffbase-search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--staffbase-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--staffbase-transition);
}

.staffbase-search-input:focus {
    outline: none;
    border-color: var(--staffbase-primary);
    box-shadow: 0 0 0 3px rgba(8, 108, 58, 0.1);
}

.staffbase-search-button {
    padding: 0.8rem 1.5rem;
    background: var(--staffbase-border) !important;
    color: white !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--staffbase-transition);
    font-size: 1.2rem;
}

.staffbase-search-button:hover {
    background: var(--staffbase-secondary) !important;
    color: white !important;
}

.staffbase-filters-form {
    width: 100%;
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--staffbase-text);
    font-size: 0.9rem;
}

.staffbase-rank-filter {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--staffbase-border);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: var(--staffbase-transition);
}

.staffbase-rank-filter:focus {
    outline: none;
    border-color: var(--staffbase-primary);
}

/* ===================================
   STAFF GRID - MOBILE (LIST)
   =================================== */

.staffbase-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Staff Card - Mobile List Layout */
.staff-card {
    background: var(--staffbase-bg);
    border: 1px solid var(--staffbase-border);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--staffbase-transition);
    box-shadow: var(--staffbase-shadow);
}

.staff-card:hover {
    box-shadow: var(--staffbase-shadow-hover);
    transform: translateY(-2px);
}

.staff-card-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    gap: 1rem;
}

.staff-card-image {
    flex-shrink: 0;
}

.staff-card .staff-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--staffbase-primary);
}

.staff-card-content {
    flex: 1;
    min-width: 0;
}

.staff-card-name {
    font-size: 1.1rem;
    margin: 0 0 0.3rem 0;
    color: var(--staffbase-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.staff-card-rank {
    color: var(--staffbase-primary);
    margin: 0 0 0.3rem 0;
    font-weight: 600;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--staffbase-bg-light);
    border-radius: 8px;
}

.no-results h2 {
    color: var(--staffbase-text);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--staffbase-text-light);
}

/* Pagination */
.staffbase-pagination {
    margin-top: 2rem;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.page-numbers {
    padding: 0.4rem 0.7rem;
    background: var(--staffbase-bg);
    border: 1px solid var(--staffbase-border);
    border-radius: 4px;
    color: var(--staffbase-text);
    text-decoration: none;
    transition: var(--staffbase-transition);
    font-size: 0.9rem;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--staffbase-primary);
    color: white;
    border-color: var(--staffbase-primary);
}

/* Mobile pagination - show only essential elements */
@media (max-width: 767px) {
    .page-numbers {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    /* Hide some page numbers on mobile, keep prev/next and current */
    .page-numbers:not(.prev):not(.next):not(.current) {
        display: none;
    }
    
    .page-numbers.current {
        display: inline-block;
    }
    
    /* Show immediate neighbors of current page */
    .page-numbers.current + .page-numbers,
    .page-numbers:has(+ .page-numbers.current) {
        display: inline-block;
    }
}

/* ===================================
   TABLET RESPONSIVENESS (768px+)
   =================================== */

@media (min-width: 768px) {
    .staffbase-single,
    .staffbase-archive {
        padding: 2rem;
    }

    .staff-avatar {
        width: 180px;
        height: 180px;
    }

    .staffbase-controls {
        flex-direction: row;
        align-items: flex-end;
    }

    .staffbase-search-wrapper {
        flex: 2;
    }

    .staffbase-filter-wrapper {
        flex: 1;
    }

    .staffbase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .filter-wrapper {
        flex-direction: row;
        align-items: center;
    }

    .filter-label {
        white-space: nowrap;
        margin-right: 0.5rem;
    }
}

/* ===================================
   DESKTOP RESPONSIVENESS (1024px+)
   GRID LAYOUT
   =================================== */

@media (min-width: 1024px) {
    .staffbase-archive {
        padding: 2rem 4rem;
    }

    /* Change to Grid Layout on Desktop */
    .staffbase-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    /* Card changes to centered vertical layout */
    .staff-card-link {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .staff-card .staff-avatar {
        width: 120px;
        height: 120px;
    }

    .staff-card-email {
        justify-content: center;
    }
}

/* ===================================
   LARGE DESKTOP (1440px+)
   =================================== */

@media (min-width: 1440px) {
    .staffbase-profile {
        max-width: 1000px;
    }

    .staffbase-archive {
        max-width: 1400px;
        margin: 0 auto;
    }
}
