/**
 * HH Family Greenhouse Frontend Styles
 * Updated with brand colors and horizontal layout
 */

/* Brand Colors */
:root {
    --hhfg-purple: #722257;
    --hhfg-yellow: #FFC745;
    --hhfg-orange: #F2A900;
    --hhfg-primary: #722257;
    --hhfg-hover: #F2A900;
}

/* Base Container */
.hhfg-jobs-container {
    margin: 2rem 0;
}

/* Jobs Header */
.hhfg-jobs-header {
    margin-bottom: 2rem;
}

/* Search Styles - UPDATED */
.hhfg-search {
    margin-bottom: 1.5rem;
}

.hhfg-search-form {
    position: relative;
}

.hhfg-search-wrapper {
    display: flex;
    max-width: 600px;
    gap: 10px; /* Added space between search input and button */
}

.hhfg-search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px; /* Full radius for separated design */
    outline: none;
    transition: border-color 0.3s;
}

.hhfg-search-input:focus {
    border-color: var(--hhfg-purple);
}

.hhfg-search-button {
    padding: 12px 24px;
    background: #722257 !important; /* Explicit purple hex with !important */
    color: white;
    border: none;
    border-radius: 50px; /* Full radius for separated button */
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    font-weight: 500;
}

.hhfg-search-button:hover {
    background: #F2A900 !important; /* Orange hover with !important */
}

/* Filter Styles */
.hhfg-filters {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hhfg-filters-horizontal .hhfg-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.hhfg-filter-group {
    flex: 1;
    min-width: 200px;
}

.hhfg-filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.hhfg-filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.hhfg-filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Filter Button Styles - Branded */
.hhfg-filter-actions .hhfg-btn-primary,
.hhfg-filter-actions button[type="submit"] {
    background: #722257 !important;
    color: #FFC745 !important;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none !important;
}

.hhfg-filter-actions .hhfg-btn-primary:hover,
.hhfg-filter-actions button[type="submit"]:hover {
    background: #F2A900 !important;
    color: white !important;
}

.hhfg-filter-actions .hhfg-btn-secondary,
.hhfg-filter-actions button[type="reset"],
.hhfg-filter-actions .hhfg-clear-filters {
    background: #6c757d !important;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none !important;
}

.hhfg-filter-actions .hhfg-btn-secondary:hover,
.hhfg-filter-actions button[type="reset"]:hover,
.hhfg-filter-actions .hhfg-clear-filters:hover {
    background: #F2A900 !important;
    color: white !important;
}

/* Button Styles */
.hhfg-btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
	color: #FFC745!important;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.hhfg-btn-primary {
    background: var(--hhfg-purple);
    color: #FFC745!important;
	text-decoration: none!important;
}

.hhfg-btn-primary:hover {
    background: var(--hhfg-hover);
    color: white!important;
}

.hhfg-btn-secondary {
    background: #6c757d;
    color: white;
}

.hhfg-btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.hhfg-btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Jobs Grid - REMOVED - Using List View as Default */

/* Jobs List - Horizontal Layout */
.hhfg-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Job Card - Horizontal Layout */
.hhfg-job-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

/* Horizontal Card Layout */
.hhfg-job-card,
.hhfg-job-card-list {
    display: flex;
    flex-direction: column;
}

.hhfg-job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.hhfg-job-card:hover {
    border-color: var(--hhfg-hover);
    box-shadow: 0 4px 12px rgba(242, 169, 0, 0.15);
    transform: translateY(-2px);
}

.hhfg-job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--hhfg-purple);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.hhfg-job-card:hover::before {
    transform: scaleY(1);
    background: var(--hhfg-hover);
}

/* Featured Job Badge */
.hhfg-featured-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--hhfg-yellow);
    color: var(--hhfg-purple);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 0 8px 0 8px;
}

.hhfg-job-featured {
    border-color: var(--hhfg-yellow);
    background: #fffbf5;
}

.hhfg-job-title {
    margin: 0;
    font-size: 1.25rem;
    flex: 1;
}

.hhfg-job-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.hhfg-job-title a:hover {
    color: var(--hhfg-purple);
}

.hhfg-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 14px;
    color: #666;
}

.hhfg-job-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hhfg-job-excerpt {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.6;
}

.hhfg-job-excerpt p {
    margin: 0;
}

.hhfg-job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.hhfg-job-date {
    color: #999;
    font-size: 14px;
}

/* Loading State */
.hhfg-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.hhfg-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--hhfg-purple);
    border-radius: 50%;
    animation: hhfg-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes hhfg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Jobs Message */
.hhfg-no-jobs {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Pagination */
.hhfg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.hhfg-pagination a,
.hhfg-pagination span {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.hhfg-pagination a:hover {
    background: var(--hhfg-hover);
    color: white;
    border-color: var(--hhfg-hover);
}

.hhfg-pagination .current {
    background: var(--hhfg-purple);
    color: var(--hhfg-yellow);
    border-color: var(--hhfg-purple);
}

/* Application Form */
.hhfg-application-form-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hhfg-application-form h3 {
    margin-bottom: 2rem;
    color: var(--hhfg-purple);
}

.hhfg-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.hhfg-fieldset legend {
    font-weight: 600;
    color: var(--hhfg-purple);
    padding: 0 10px;
}

.hhfg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hhfg-form-group {
    margin-bottom: 1rem;
}

.hhfg-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.hhfg-form-group input[type="text"],
.hhfg-form-group input[type="email"],
.hhfg-form-group input[type="tel"],
.hhfg-form-group input[type="url"],
.hhfg-form-group textarea,
.hhfg-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.hhfg-form-group input:focus,
.hhfg-form-group textarea:focus,
.hhfg-form-group select:focus {
    outline: none;
    border-color: var(--hhfg-purple);
    box-shadow: 0 0 0 2px rgba(114, 34, 87, 0.1);
}

.hhfg-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.required {
    color: #dc3545;
}

.hhfg-field-description {
    font-size: 13px;
    color: #666;
    margin-top: 0.25rem;
}

.hhfg-checkbox-group label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.hhfg-checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    accent-color: var(--hhfg-purple);
}

.hhfg-form-actions {
    text-align: center;
    margin-top: 2rem;
}

.hhfg-form-actions .hhfg-btn {
    min-width: 150px;
}

.hhfg-hidden {
    display: none !important;
}

/* Messages */
.hhfg-messages {
    margin-top: 1rem;
}

.hhfg-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.hhfg-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hhfg-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hhfg-message-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Single Job Page */
.hhfg-single-job {
    max-width: 1200px;
    margin: 0 auto;
}

.hhfg-job-header {
    background: linear-gradient(135deg, rgba(114, 34, 87, 0.05), rgba(255, 199, 69, 0.05));
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(114, 34, 87, 0.1);
}

.hhfg-job-header h1 {
    margin: 0 0 1rem;
    color: var(--hhfg-purple);
}

.hhfg-job-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.hhfg-job-details-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.hhfg-job-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hhfg-job-content h2,
.hhfg-job-content h3,
.hhfg-job-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--hhfg-purple);
}

.hhfg-job-content ul,
.hhfg-job-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.hhfg-job-apply-cta {
    background: var(--hhfg-purple);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

.hhfg-job-apply-cta h3 {
    margin: 0 0 1rem;
    color: var(--hhfg-yellow);
}

.hhfg-job-apply-cta .hhfg-btn {
    background: var(--hhfg-yellow);
    color: var(--hhfg-purple);
    font-weight: 600;
}

.hhfg-job-apply-cta .hhfg-btn:hover {
    background: var(--hhfg-hover);
    color: white;
}

/* Status Badges */
.hhfg-status {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.hhfg-status-success {
    background: #d4edda;
    color: #155724;
}

.hhfg-status-warning {
    background: var(--hhfg-yellow);
    color: var(--hhfg-purple);
}

.hhfg-status-error {
    background: #f8d7da;
    color: #721c24;
}

/* Icons (using dashicons or custom) */
.hhfg-icon-department::before,
.hhfg-icon-location::before,
.hhfg-icon-type::before {
    font-family: 'dashicons';
    font-size: 16px;
    margin-right: 4px;
    vertical-align: middle;
    color: var(--hhfg-purple);
}

.hhfg-icon-department::before {
    content: '\f307';
}

.hhfg-icon-location::before {
    content: '\f230';
}

.hhfg-icon-type::before {
    content: '\f321';
}

/* Greenhouse Embedded Application Form Support */
.hhfg-greenhouse-embed {
    margin: 3rem 0;
    padding: 0;
    background: transparent;
    border-radius: 8px;
}

.hhfg-greenhouse-embed h3 {
    color: var(--hhfg-purple);
    margin-bottom: 2rem;
    font-size: 1.75rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--hhfg-yellow);
}

/* Container for iframe */
#grnhse_app {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

/* Hide the Greenhouse job header inside iframe (limited effectiveness) */
#grnhse_iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    background: white;
    /* Try to hide the top portion */
    margin-top: -200px; /* Adjust based on header height */
    padding-top: 200px;
}

/* Alternative: Cover the job header with an overlay */
#grnhse_app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px; /* Adjust to cover Greenhouse's header */
    background: white;
    z-index: 1;
    display: none; /* Enable if needed */
}

/* Custom form styles (if using Option 1) */
.hhfg-application-form {
    max-width: 100%;
}

.hhfg-application-form .hhfg-fieldset {
    background: #f8f9fa;
    border: none;
    margin-bottom: 2rem;
}

.hhfg-application-form .hhfg-form-group input[type="file"] {
    padding: 0.5rem;
    background: white;
}

.hhfg-application-form .hhfg-form-actions {
    background: transparent;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

/* Application Success Message */
.hhfg-application-success {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(114, 34, 87, 0.05), rgba(255, 199, 69, 0.05));
    border: 2px solid var(--hhfg-yellow);
    animation: successSlide 0.5s ease-out;
}

@keyframes successSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hhfg-success-icon {
    width: 60px;
    height: 60px;
    background: var(--hhfg-purple);
    color: var(--hhfg-yellow);
    font-size: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-weight: bold;
}

.hhfg-application-success h4 {
    color: var(--hhfg-purple);
    margin: 1rem 0;
}

/* Application Section */
.hhfg-application-section {
    scroll-margin-top: 100px;
    margin: 3rem 0;
    position: relative;
}

/* Loading state for iframe */
.hhfg-greenhouse-embed::before {
    content: '';
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--hhfg-purple);
    border-radius: 50%;
    animation: hhfg-spin 1s linear infinite;
}

.hhfg-greenhouse-embed.loading::before {
    display: block;
}

/* External Application Fallback */
.hhfg-external-application {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.hhfg-external-application h3 {
    color: var(--hhfg-purple);
    margin-bottom: 1rem;
}

/* Modal Styles */
.hhfg-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hhfg-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hhfg-modal-content h3 {
    color: var(--hhfg-purple);
    margin-bottom: 1.5rem;
    padding-right: 40px; /* Space for close button */
}

.hhfg-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.hhfg-modal-close:hover,
.hhfg-modal-close:focus {
    color: var(--hhfg-purple);
    background: rgba(114, 34, 87, 0.1);
}

/* Back Link Styling */
.hhfg-back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.hhfg-back-link-btn {
    color: var(--hhfg-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hhfg-back-link-btn:hover {
    color: var(--hhfg-hover);
}

/* Related Jobs Section */
.hhfg-related-jobs {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.hhfg-related-jobs h3 {
    color: var(--hhfg-purple);
    margin-bottom: 1.5rem;
}

/* Thank You Page Styles */
.hhfg-thank-you {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(114, 34, 87, 0.05), rgba(255, 199, 69, 0.05));
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
}

.hhfg-thank-you h2 {
    color: var(--hhfg-purple);
    margin-bottom: 1rem;
}

.hhfg-thank-you .hhfg-icon-success {
    font-size: 48px;
    color: var(--hhfg-yellow);
    background: var(--hhfg-purple);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hhfg-job-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hhfg-job-meta {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .hhfg-filters-horizontal .hhfg-filter-form {
        flex-direction: column;
    }
    
    .hhfg-filter-group {
        width: 100%;
    }
    
    .hhfg-form-row {
        grid-template-columns: 1fr;
    }
    
    .hhfg-job-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .hhfg-job-footer .hhfg-btn {
        width: 100%;
        text-align: center;
    }
    
    .hhfg-search-wrapper {
        max-width: 100%;
        flex-direction: column; /* Stack search input and button on mobile */
        gap: 10px;
    }
    
    .hhfg-search-input,
    .hhfg-search-button {
        width: 100%;
        border-radius: 50px; /* Keep full radius on mobile */
    }
    
    .hhfg-message-floating {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .hhfg-featured-badge {
        position: static;
        display: inline-block;
        margin-bottom: 0.5rem;
        border-radius: 4px;
    }
}

/* Print Styles */
@media print {
    .hhfg-search,
    .hhfg-filters,
    .hhfg-pagination,
    .hhfg-btn,
    .hhfg-job-apply-cta {
        display: none !important;
    }
    
    .hhfg-job-card {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
}