/**
 * Job Offers Plugin Styles
 * Green theme matching the existing site design
 */

/* Main Container */
.gg-job-offers-container {
    margin: 40px auto;
    width: 100%;
    max-width: 1200px;
}

/* Grid Layout */
.gg-job-offers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 -15px;
    padding: 30px 0;
}

/* Grid Columns */
.gg-job-offers-grid.columns-1 .gg-job-offer-item {
    width: calc(100% - 30px);
    max-width: 400px;
}

.gg-job-offers-grid.columns-2 .gg-job-offer-item {
    width: calc(50% - 30px);
    max-width: 400px;
}

.gg-job-offers-grid.columns-3 .gg-job-offer-item {
    width: calc(33.333% - 30px);
    max-width: 350px;
}

.gg-job-offers-grid.columns-4 .gg-job-offer-item {
    width: calc(25% - 30px);
    max-width: 280px;
}

/* Individual Job Offer Item */
.gg-job-offer-item {
    margin: 15px;
    position: relative;
    margin-top: 55px; /* Make space for protruding icon */
}

.gg-job-card {
    background: #f1f5ec;
    border-radius: 16px;
    padding: 50px 25px 30px; /* Extra top padding for icon */
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Allow icon to protrude */
    border: 1px solid #f0f0f0;
    min-height: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gg-job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Green accent at top */
.gg-job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #759E41 20%, #759E41 80%, transparent 100%);
    border-radius: 0 0 2px 2px;
}

/* Job Icon - Protruding above top border */
.gg-job-icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%); /* Center horizontally and move 50% above border */
    z-index: 10;
    margin-bottom: 0;
}

.gg-job-icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    padding: 5px;
    background-color: #759E41;
    border: 4px solid #759E41;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gg-job-card:hover .gg-job-icon img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(117, 158, 65, 0.3);
}

.gg-job-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #759E41, #8BB152);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    transition: all 0.3s ease;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gg-job-card:hover .gg-job-icon-placeholder {
    transform: scale(1.05);
    background: linear-gradient(135deg, #8BB152, #9BC661);
    box-shadow: 0 6px 20px rgba(117, 158, 65, 0.3);
}

/* Job Content */
.gg-job-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gg-job-title {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 10px 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.gg-job-card:hover .gg-job-title {
    color: #759E41;
}

.gg-job-type {
    display: inline-block;
    padding: 4px 12px;
    background: #f8fdf4;
    color: #759E41;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    margin-bottom: 15px;
    border: 1px solid #e8f5d8;
}

.gg-job-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gg-job-location {
    font-size: 13px;
    color: #888888;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.gg-job-location i {
    font-size: 14px;
    color: #759E41;
}

/* CTA Button */
.gg-job-cta-button {
    background: linear-gradient(135deg, #759E41, #8BB152);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(117, 158, 65, 0.3);
    margin-top: auto;
}

.gg-job-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(117, 158, 65, 0.4);
    background: linear-gradient(135deg, #8BB152, #9BC661);
}

.gg-job-cta-button:active {
    transform: translateY(0);
}

/* Modal Styles */
.gg-job-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal shake animation for validation errors */
@keyframes modalShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.gg-job-modal.shake-error .gg-job-modal-container {
    animation: modalShake 0.6s ease-in-out;
}

.gg-job-modal-overlay {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    padding: 40px 20px;
    overflow-y: auto;
}

.gg-job-modal-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin: auto;
}

.gg-job-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.gg-job-modal-close:hover {
    color: #759E41;
    background: rgba(117, 158, 65, 0.1);
}

/* Modal Header */
.gg-job-modal-header {
    background: linear-gradient(135deg, #759E41, #8BB152);
    color: white;
    padding: 30px 30px 25px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.gg-job-modal-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.2;
    padding-right: 50px;
}

.gg-job-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.gg-job-modal-meta > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gg-job-modal-meta i {
    font-size: 16px;
    opacity: 0.8;
}

/* Modal Body */
.gg-job-modal-body {
    padding: 30px;
    line-height: 1.6;
    color: #333;
}

.gg-job-modal-description {
    margin-bottom: 30px;
}

.gg-job-modal-description h3,
.gg-job-modal-description h4 {
    color: #759E41;
    margin-top: 25px;
    margin-bottom: 15px;
}

.gg-job-modal-description ul,
.gg-job-modal-description ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.gg-job-modal-description li {
    margin-bottom: 8px;
}

.gg-job-modal-requirements,
.gg-job-modal-benefits {
    background: #f8fdf4;
    border-left: 4px solid #759E41;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
}

.gg-job-modal-requirements h4,
.gg-job-modal-benefits h4 {
    color: #759E41;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.gg-job-modal-form {
    background: #ffffff;
    border: 2px solid #e8f5d8;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.gg-job-modal-form h4 {
    color: #759E41;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

/* Contact Form 7 Styling inside modal */
.gg-job-modal-form .wpcf7-form {
    margin: 0;
}

.gg-job-modal-form .wpcf7-form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8f5d8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
}

.gg-job-modal-form .wpcf7-form-control:focus {
    border-color: #759E41;
    outline: none;
    box-shadow: 0 0 0 3px rgba(117, 158, 65, 0.1);
}

.gg-job-modal-form .wpcf7-submit {
    background: linear-gradient(135deg, #759E41, #8BB152);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.gg-job-modal-form .wpcf7-submit:hover {
    background: linear-gradient(135deg, #8BB152, #9BC661);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(117, 158, 65, 0.3);
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gg-job-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.gg-job-card:nth-child(1) { animation-delay: 0.1s; }
.gg-job-card:nth-child(2) { animation-delay: 0.2s; }
.gg-job-card:nth-child(3) { animation-delay: 0.3s; }
.gg-job-card:nth-child(4) { animation-delay: 0.4s; }

/* Responsive Design */
@media (max-width: 1024px) {
    .gg-job-offers-grid.columns-4 .gg-job-offer-item {
        width: calc(33.333% - 30px);
    }
    
    .gg-job-modal-container {
        margin: 20px auto;
        max-height: 85vh;
    }
}

@media (max-width: 768px) {
    .gg-job-offers-container {
        padding: 0 15px;
    }
    
    .gg-job-offers-grid {
        gap: 25px;
        margin: 0 -10px;
    }
    
    .gg-job-offer-item {
        margin: 10px;
        margin-top: 50px; /* Adjusted for mobile */
    }
    
    .gg-job-offers-grid.columns-3 .gg-job-offer-item,
    .gg-job-offers-grid.columns-4 .gg-job-offer-item {
        width: calc(50% - 25px);
    }
    
    .gg-job-card {
        padding: 45px 20px 25px; /* Adjusted padding for mobile */
        min-height: 280px;
    }
    
    .gg-job-icon img,
    .gg-job-icon-placeholder {
        width: 70px;
        height: 70px;
    }
    
    .gg-job-title {
        font-size: 18px;
    }
    
    .gg-job-modal-overlay {
        padding: 20px 15px;
    }
    
    .gg-job-modal-container {
        max-height: 90vh;
    }
    
    .gg-job-modal-title {
        font-size: 24px;
        padding-right: 40px;
    }
    
    .gg-job-modal-header {
        padding: 25px 20px 20px;
    }
    
    .gg-job-modal-body {
        padding: 25px 20px;
    }
    
    .gg-job-modal-meta {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .gg-job-offers-grid {
        gap: 20px;
        margin: 0 -5px;
    }
    
    .gg-job-offer-item {
        margin: 5px;
        margin-top: 45px; /* Adjusted for small mobile */
    }
    
    .gg-job-offers-grid.columns-2 .gg-job-offer-item,
    .gg-job-offers-grid.columns-3 .gg-job-offer-item,
    .gg-job-offers-grid.columns-4 .gg-job-offer-item {
        width: calc(100% - 20px);
        max-width: 350px;
    }
    
    .gg-job-card {
        padding: 40px 15px 20px; /* Adjusted padding for small mobile */
        min-height: 260px;
    }
    
    .gg-job-icon img,
    .gg-job-icon-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .gg-job-title {
        font-size: 17px;
    }
    
    .gg-job-cta-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .gg-job-modal-overlay {
        padding: 10px;
    }
    
    .gg-job-modal-title {
        font-size: 20px;
    }
    
    .gg-job-modal-header {
        padding: 20px 15px 15px;
    }
    
    .gg-job-modal-body {
        padding: 20px 15px;
    }
    
    .gg-job-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
}

/* Print styles */
@media print {
    .gg-job-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gg-job-cta-button {
        display: none;
    }
    
    .gg-job-modal {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gg-job-card {
        border: 2px solid #333;
    }
    
    .gg-job-title {
        color: #000;
    }
    
    .gg-job-cta-button {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gg-job-card,
    .gg-job-icon img,
    .gg-job-icon-placeholder,
    .gg-job-cta-button {
        transition: none;
        animation: none;
    }
    
    .gg-job-card:hover {
        transform: none;
    }
}