/**
 * AGI Careers - Front-end Styles
 * Version: 1.0.0
 */

:root {
    --agi-primary: #1e40af;
    --agi-secondary: #64748b;
    --agi-accent: #3b82f6;
    --agi-text: #1e293b;
    --agi-text-light: #64748b;
    --agi-border: #e2e8f0;
    --agi-bg: #f8fafc;
    --agi-white: #ffffff;
    --agi-radius: 8px;
    --agi-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Archive - Jobs List */

.agi-careers-archive {
    background-color: #f3f4f6; /* bg-gray-100 from Tailwind */
}

.agi-careers-hero {
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    align-items: stretch;
    background: var(--agi-primary);
}

.agi-careers-hero .container {
    flex: 1 1 100%;
}

/* Mejorar el layout para el hero container */
.agi-careers-hero .container {
    display: flex;
    height: 100%;
    align-items: stretch;
    justify-content: space-between;
}
.careers-hero--content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}
.careers-hero--img {
    align-self: flex-end;
    pointer-events: none;
}

.agi-jobs-filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--agi-white);
    border-radius: var(--agi-radius);
    box-shadow: var(--agi-shadow);
}

.agi-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Job Card */
.agi-job-card {
    padding: 1.5rem;
    background: var(--agi-white);
    border: 1px solid var(--agi-border);
    border-radius: var(--agi-radius);
    box-shadow: var(--agi-shadow);
    transition: all 0.3s ease;
}

.agi-job-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Single Job */
.agi-job-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background-color: #f3f4f6;
    padding: 0 0 120px 0;
}

@media (max-width: 768px) {
    .agi-job-single {
        grid-template-columns: 1fr;
    }
}

/* Job Hero */
.agi-job-hero {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--agi-white);
    margin-bottom: 0;
}

/* Breadcrumb */
.agi-breadcrumb {
    padding: 0;
    font-size: 0.875rem;
    color: var(--agi-text-light);
    margin-bottom: 32px;
}

/* Job Summary */
.agi-job-summary {
    padding: 1.5rem;
    background: var(--agi-bg);
    border-radius: var(--agi-radius);
    margin-bottom: 2rem;
}

/* Job Description Content Styles */
.agi-job-description {
    line-height: 1.7;
}

.agi-job-description p {
    margin-bottom: 1.25rem;
    color: var(--agi-text);
    font-size: 1rem;
    line-height: 1.7;
}

.agi-job-description p:last-child {
    margin-bottom: 0;
}

.agi-job-description h1,
.agi-job-description h2,
.agi-job-description h3,
.agi-job-description h4 {
    color: var(--agi-text);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.agi-job-description h1:first-child,
.agi-job-description h2:first-child,
.agi-job-description h3:first-child,
.agi-job-description h4:first-child {
    margin-top: 0;
}

.agi-job-description h2 {
    font-size: 1.5rem;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.agi-job-description h3 {
    font-size: 1.25rem;
    color: #334155;
    position: relative;
    padding-left: 1rem;
}

.agi-job-description h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 4px;
    height: 1.25rem;
    background: #3B82F6;
    border-radius: 2px;
}

.agi-job-description h4 {
    font-size: 1.125rem;
    color: #475569;
}

.agi-job-description ul,
.agi-job-description ol {
    margin: 1.25rem 0;
    padding-left: 1.75rem;
}

.agi-job-description ul {
    list-style-type: none;
}

.agi-job-description ul li {
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    color: var(--agi-text);
    line-height: 1.6;
}

.agi-job-description ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #3B82F6;
    font-weight: 700;
    font-size: 1.1rem;
}

.agi-job-description ol {
    list-style-type: decimal;
    list-style-position: outside;
}

.agi-job-description ol li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    color: var(--agi-text);
    line-height: 1.6;
}

.agi-job-description ol li::marker {
    color: #3B82F6;
    font-weight: 700;
}

.agi-job-description strong,
.agi-job-description b {
    font-weight: 600;
    color: #1e293b;
}

.agi-job-description em,
.agi-job-description i {
    font-style: italic;
    color: var(--agi-text-light);
}

.agi-job-description a {
    color: #3B82F6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.agi-job-description a:hover {
    color: #1E40AF;
}

.agi-job-description blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #3B82F6;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--agi-text-light);
}

.agi-job-description code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #dc2626;
}

.agi-job-description pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.agi-job-description pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.agi-job-description hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2rem 0;
}

.agi-job-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.agi-job-description table th,
.agi-job-description table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.agi-job-description table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--agi-text);
}

.agi-job-description table tr:hover {
    background: #f8fafc;
}

/* Sidebar */
.agi-job-sidebar {
    position: sticky;
    top: 2rem;
}

.agi-sidebar-widget {
    padding: 1.5rem;
    background: var(--agi-white);
    border: 1px solid var(--agi-border);
    border-radius: var(--agi-radius);
    margin-bottom: 1.5rem;
}

@media screen and (max-width: 768px) {
    .agi-sidebar-widget.apply-button {
        margin-bottom: 0 !important;
    }
}

/* Buttons */
.agi-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--agi-primary);
    color: var(--agi-white);
    text-decoration: none;
    border-radius: var(--agi-radius);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.agi-btn:hover {
    background: var(--agi-accent);
    color: var(--agi-white);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.agi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.agi-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.agi-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.agi-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    animation: modalSlideIn 0.3s ease-out;
}

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

.agi-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.agi-modal-close:hover {
    background: #F3F4F6;
    color: #1F2937;
}

body.agi-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.agi-form-label {
    display: block;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
    font-size: 14px;
}

.agi-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: white;
}

.agi-form-input:focus {
    outline: none;
    border-color: var(--agi-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.agi-form-input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.agi-form-input::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.agi-form-input::file-selector-button:hover {
    background: #E5E7EB;
}

textarea.agi-form-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.agi-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

.agi-btn-primary,
.agi-btn-secondary {
    min-width: 120px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.agi-btn-primary {
    background: var(--agi-primary);
    color: white;
}

.agi-btn-primary:hover:not(:disabled) {
    background: var(--agi-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.agi-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.agi-btn-secondary {
    background: #F3F4F6;
    color: #1F2937;
}

.agi-btn-secondary:hover {
    background: #E5E7EB;
}

/* Application Form Styles */
#agi-application-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#agi-application-form .agi-form-group {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 250px;
}

#agi-application-form .agi-form-group.w-full {
    flex: 1 1 100%;
}

@media (max-width: 768px) {
    #agi-application-form .agi-form-group {
        flex: 1 1 100%;
    }
}

.agi-form-message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

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

.agi-message-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.agi-message-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.agi-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0 2rem;
    list-style: none;
    padding: 0;
}

.agi-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0.625rem 1rem;
    background: var(--agi-white);
    color: var(--agi-text);
    border: 1px solid var(--agi-border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease-in-out;
    line-height: 1;
}

.agi-pagination .page-numbers:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agi-pagination .page-numbers.current {
    background: #3B82F6;
    color: var(--agi-white);
    border-color: #3B82F6;
    cursor: default;
    pointer-events: none;
    font-weight: 600;
}

.agi-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    pointer-events: none;
    color: var(--agi-text-light);
    font-weight: 400;
}

.agi-pagination .page-numbers.prev,
.agi-pagination .page-numbers.next {
    font-weight: 500;
    padding: 0.625rem 1.125rem;
    gap: 0.5rem;
}

.agi-pagination .page-numbers.prev:hover,
.agi-pagination .page-numbers.next:hover {
    background: #3B82F6;
    color: var(--agi-white);
    border-color: #3B82F6;
}

/* Remove default arrows and add custom ones */
.agi-pagination .page-numbers.prev::before,
.agi-pagination .page-numbers.next::after {
    display: none;
}

/* Pagination - Variant for archive pages */
.agi-careers-archive .agi-pagination {
    margin-top: 4rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .agi-modal-content {
        padding: 24px;
        max-height: 95vh;
    }
    
    .agi-form-actions {
        flex-direction: column;
    }
    
    .agi-btn-primary,
    .agi-btn-secondary {
        width: 100%;
    }
    
    /* Pagination responsive */
    .agi-pagination {
        gap: 0.375rem;
        flex-wrap: wrap;
    }
    
    .agi-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0.5rem 0.625rem;
        font-size: 0.875rem;
    }
    
    .agi-pagination .page-numbers.prev,
    .agi-pagination .page-numbers.next {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.agi-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.agi-modal-content {
    position: relative;
    background-color: var(--agi-white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--agi-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Privacy Notice Section */
.agi-privacy-notice {
    background-color: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--agi-radius);
    padding: 1.5rem;
    margin: 0 auto;
}

.agi-privacy-notice h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
}

.agi-privacy-notice p {
    font-size: 0.85rem;
    color: #1e40af;
    line-height: 1.5;
    margin: 0.75rem 0;
}

.agi-privacy-notice a {
    color: #1e3a8a;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.agi-privacy-notice a:hover {
    color: #1e40af;
}

.agi-consent-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0;
}

.agi-form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--agi-primary);
}

.agi-consent-group label {
    font-size: 0.85rem;
    color: #1e3a8a;
    cursor: pointer;
    line-height: 1.4;
    flex: 1;
}

.agi-consent-group label a {
    font-weight: 600;
    text-decoration: underline;
    color: #1e3a8a;
}

.agi-consent-group label a:hover {
    color: #1e40af;
}

.agi-recaptcha-notice {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.agi-recaptcha-notice a {
    color: #64748b;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.agi-recaptcha-notice a:hover {
    color: #475569;
}

/* Accessibility */
.agi-consent-group input[type="checkbox"]:focus {
    outline: 2px solid var(--agi-primary);
    outline-offset: 2px;
}

.agi-consent-group input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

