/* ===== JOB PORTAL ===== */
.job-portal {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

#portal-bg {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0; pointer-events: none;
}

/* ===== HERO ===== */
.portal-hero {
    position: relative; z-index: 2; min-height: 70vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 120px 40px 40px;
}
.portal-hero .bg-title {
    position: absolute;
    font-size: clamp(4rem, 16vw, 14rem); font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 2px rgba(124,58,237,0.06); text-stroke: 2px rgba(124,58,237,0.06);
    letter-spacing: 0.06em; pointer-events: none; user-select: none;
    animation: phPulse 5s ease-in-out infinite;
}
@keyframes phPulse {
    0%, 100% { -webkit-text-stroke-color: rgba(124,58,237,0.06); }
    50% { -webkit-text-stroke-color: rgba(124,58,237,0.14); }
}
.portal-hero h1 {
    font-size: clamp(2rem, 5vw, 4rem); font-weight: 900; letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #7c3aed 35%, #06b6d4 65%, #ec4899 100%);
    -webkit-text-fill-color: transparent; background-clip: text; -webkit-background-clip: text;
    position: relative; z-index: 1; line-height: 1.15;
}
.portal-hero .subtitle {
    color: var(--text-secondary); letter-spacing: 4px; text-transform: uppercase;
    margin-top: 14px; font-size: clamp(0.5rem, 0.8vw, 0.65rem);
    max-width: 550px; line-height: 1.8; position: relative; z-index: 1;
}
.portal-hero .scroll-hint {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.12); font-size: 0.5rem; letter-spacing: 3px;
    text-transform: uppercase; animation: phHint 2.5s ease-in-out infinite;
}
@keyframes phHint {
    0%, 100% { opacity: 0.12; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.4; transform: translateX(-50%) translateY(5px); }
}

/* ===== SEARCH ===== */
.portal-search {
    position: relative; z-index: 2;
    max-width: 480px; margin: -20px auto 50px; padding: 0 20px;
}
.portal-search .ps-wrap {
    position: relative; display: flex; align-items: center;
    background: rgba(19,28,49,0.5); backdrop-filter: blur(20px);
    border: 1px solid rgba(124,58,237,0.15); border-radius: 14px;
    padding: 4px; transition: all 0.4s ease;
    box-shadow: 0 0 30px rgba(124,58,237,0.03);
}
.portal-search .ps-wrap:focus-within {
    border-color: rgba(124,58,237,0.5);
    box-shadow: 0 0 40px rgba(124,58,237,0.1);
}
.portal-search .ps-wrap svg {
    flex-shrink: 0; width: 18px; height: 18px; margin-left: 16px;
    color: rgba(255,255,255,0.2);
}
.portal-search .ps-wrap input {
    flex: 1; background: none; border: none; outline: none;
    padding: 14px 16px; font-size: 0.85rem; color: #fff; font-family: inherit;
}
.portal-search .ps-wrap input::placeholder {
    color: rgba(255,255,255,0.15); letter-spacing: 1px;
    text-transform: uppercase; font-size: 0.65rem;
}

/* ===== AI SCANNER ===== */
.portal-scanner {
    position: fixed; top: 50%; left: 50%;
    width: min(400px, 65vw); height: min(400px, 65vw);
    transform: translate(-50%, -50%);
    z-index: 100; pointer-events: none; opacity: 0;
    transition: opacity 0.8s ease;
}
.portal-scanner.active { opacity: 1; }
.portal-scanner .ps-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid rgba(124,58,237,0.08);
    animation: psPulse 4s ease-in-out infinite;
}
.portal-scanner .ps-ring:nth-child(2) { animation-delay: 0.6s; }
.portal-scanner .ps-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes psPulse {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.4; }
}
.portal-scanner .ps-arc {
    position: absolute; inset: -2px; border-radius: 50%;
    border: 2px solid transparent; border-top-color: #7c3aed; border-right-color: #06b6d4;
    animation: psRotate 7s linear infinite; filter: blur(1px);
    box-shadow: 0 0 20px rgba(124,58,237,0.1);
}
@keyframes psRotate { to { transform: rotate(360deg); } }
.portal-scanner .ps-spin {
    position: absolute; top: 50%; left: 50%; width: 150%; height: 1px;
    transform: translate(-50%, -50%) rotate(0deg);
    background: linear-gradient(90deg, transparent, #7c3aed, #06b6d4, transparent);
    animation: psSpin 9s linear infinite; opacity: 0.2;
}
@keyframes psSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.portal-scanner .ps-info {
    position: absolute; bottom: -65px; left: 50%; transform: translateX(-50%);
    text-align: center; opacity: 0; transition: all 0.5s ease; white-space: nowrap;
}
.portal-scanner.active .ps-info { opacity: 1; bottom: -50px; }
.ps-info .psi-name {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
    background: linear-gradient(90deg, #7c3aed, #06b6d4);
    -webkit-text-fill-color: transparent; background-clip: text; -webkit-background-clip: text;
}
.ps-info .psi-detail {
    font-size: 0.5rem; color: rgba(255,255,255,0.2); letter-spacing: 2px; text-transform: uppercase; margin-top: 4px;
}

/* ===== ARCHIVE SHELVES ===== */
.portal-archive {
    position: relative; z-index: 1;
    max-width: 1300px; margin: 0 auto; padding: 20px 40px 80px;
    perspective: 2000px;
}

.archive-shelf {
    margin-bottom: 50px;
    position: relative;
}

.archive-shelf::before {
    content: '';
    position: absolute; bottom: -10px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.06), rgba(6,182,212,0.06), transparent);
}

.shelf-label {
    font-size: 0.55rem; text-transform: uppercase; letter-spacing: 3px;
    color: rgba(255,255,255,0.15); margin-bottom: 16px; display: block;
}

.shelf-files {
    display: flex; gap: 16px; flex-wrap: wrap;
}

/* ===== DIGITAL FILE FOLDER ===== */
.digital-file {
    position: relative;
    width: 200px; min-height: 240px;
    border-radius: 14px;
    background: rgba(19,28,49,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 20px 18px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
    transform-style: preserve-3d;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.digital-file::before {
    content: '';
    position: absolute; inset: 0; border-radius: 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.03), transparent);
    opacity: 0; transition: opacity 0.5s ease;
    pointer-events: none;
}

.digital-file .df-folder-icon {
    width: 36px; height: 28px;
    border-radius: 4px 10px 4px 4px;
    margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
    transition: all 0.4s ease;
    position: relative;
}

.digital-file .df-folder-icon::after {
    content: '';
    position: absolute; top: -4px; left: 0;
    width: 14px; height: 4px;
    border-radius: 2px 2px 0 0;
}

.digital-file .df-title {
    font-size: 0.7rem; font-weight: 700; margin-bottom: 4px;
    letter-spacing: 0.3px; line-height: 1.3; flex: 1;
}

.digital-file .df-company {
    font-size: 0.55rem; color: rgba(255,255,255,0.3);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px;
}

.digital-file .df-location {
    font-size: 0.5rem; color: rgba(255,255,255,0.15);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

.digital-file .df-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.digital-file .df-days {
    font-size: 0.5rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.digital-file .df-status {
    width: 8px; height: 8px; border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* File status colors */
.digital-file.status-new .df-days { color: #10b981; }
.digital-file.status-new .df-status { background: #10b981; color: #10b981; }
.digital-file.status-active .df-days { color: #7c3aed; }
.digital-file.status-active .df-status { background: #7c3aed; color: #7c3aed; }
.digital-file.status-old .df-days { color: #f59e0b; }
.digital-file.status-old .df-status { background: #f59e0b; color: #f59e0b; }

/* Hover */
.digital-file:hover {
    transform: translateZ(20px) scale(1.04);
    border-color: rgba(124,58,237,0.15);
    box-shadow: 0 15px 50px rgba(124,58,237,0.1);
}
.digital-file:hover::before { opacity: 1; }
.digital-file:hover .df-folder-icon { transform: scale(1.1); }
.digital-file:hover .df-title { color: #fff; }

/* Magnetic pre-hover */
.digital-file.magnetic {
    border-color: rgba(124,58,237,0.1);
    box-shadow: 0 0 30px rgba(124,58,237,0.05);
}

/* File open state */
.digital-file.open {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1) !important;
    width: min(700px, 90vw); min-height: 60vh;
    z-index: 1000;
    padding: 40px 36px;
    background: rgba(19,28,49,0.95);
    backdrop-filter: blur(40px);
    border-color: rgba(124,58,237,0.2);
    box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 60px rgba(124,58,237,0.08);
    cursor: default;
    overflow-y: auto;
}

.digital-file.open .df-folder-icon { display: none; }
.digital-file.open .df-company { font-size: 0.65rem; margin-bottom: 4px; }
.digital-file.open .df-title { font-size: 1.2rem; margin-bottom: 8px; }
.digital-file.open .df-location { font-size: 0.6rem; margin-bottom: 16px; }
.digital-file.open .df-footer { display: none; }

.digital-file.open .df-poster {
    display: block;
}

.file-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.file-backdrop.open { opacity: 1; pointer-events: auto; }

.df-poster {
    display: none;
    position: relative;
}

.df-poster .dfp-visual {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 14px;
    background: rgba(19,28,49,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    transition: all 0.4s ease;
}

.df-poster .dfp-visual:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.dfp-visual .dfp-placeholder {
    text-align: center;
}
.dfp-placeholder .dfp-icon {
    width: 60px; height: 60px; margin: 0 auto 12px;
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800;
}
.dfp-placeholder .dfp-label {
    font-size: 0.55rem; color: rgba(255,255,255,0.15);
    text-transform: uppercase; letter-spacing: 2px;
}

.df-poster .dfp-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}

.dfp-body .dfp-col h4 {
    font-size: 0.55rem; text-transform: uppercase; letter-spacing: 2px;
    color: rgba(124,58,237,0.4); margin-bottom: 8px;
}
.dfp-body .dfp-col p {
    font-size: 0.75rem; color: var(--text-secondary); line-height: 1.7;
}

.dfp-body .dfp-col .dfp-tags {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.dfp-body .dfp-col .dfp-tag {
    padding: 3px 10px; border-radius: 8px;
    font-size: 0.5rem; font-weight: 600; text-transform: uppercase;
    background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.08);
    color: rgba(255,255,255,0.3);
}

.df-poster .dfp-actions {
    display: flex; gap: 12px; margin-top: 20px;
    padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.04);
}
.dfp-actions .dfp-btn {
    padding: 10px 28px; border-radius: 10px;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    border: none; cursor: pointer; transition: all 0.4s ease;
    font-family: inherit;
}
.dfp-actions .dfp-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: #fff;
}
.dfp-actions .dfp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.2);
}
.dfp-actions .dfp-btn-close {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.06);
}
.dfp-actions .dfp-btn-close:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* ===== DIRECTORY ===== */
.portal-directory {
    position: relative; z-index: 1;
    padding: 60px 40px 100px;
    max-width: 1300px; margin: 0 auto;
}
.portal-directory h3 {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 3px;
    color: rgba(255,255,255,0.3); margin-bottom: 24px; text-align: center;
}
.directory-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.dir-card {
    padding: 24px 20px; border-radius: 14px;
    background: rgba(19,28,49,0.3);
    border: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    transform-style: preserve-3d;
    text-align: center;
}
.dir-card:hover {
    transform: translateZ(15px) scale(1.03);
    border-color: rgba(124,58,237,0.15);
    box-shadow: 0 10px 40px rgba(124,58,237,0.08);
}
.dir-card .dc-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 2px;
}
.dir-card .dc-meta {
    font-size: 0.5rem; color: rgba(255,255,255,0.2);
    text-transform: uppercase; letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .shelf-files { gap: 12px; }
    .digital-file { width: 170px; min-height: 200px; padding: 16px; }
    .directory-grid { grid-template-columns: repeat(2, 1fr); }
    .df-poster .dfp-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .portal-hero { padding: 80px 20px 30px; min-height: 60vh; }
    .portal-hero h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
    .portal-hero .bg-title { font-size: clamp(3rem, 12vw, 6rem); }
    .portal-hero .scroll-hint { display: none; }
    .portal-archive { padding: 10px 20px 60px; }
    .shelf-files { gap: 10px; }
    .digital-file { width: calc(50% - 10px); min-height: 180px; padding: 14px; }
    .digital-file.open { width: 95vw; min-height: 50vh; padding: 24px 20px; }
    .directory-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .portal-directory { padding: 40px 20px 80px; }
    .portal-scanner { width: min(240px, 70vw); height: min(240px, 70vw); }
    .portal-scanner .ps-info { display: none; }
}

@media (max-width: 480px) {
    .portal-hero { padding: 60px 16px 20px; }
    .portal-hero .bg-title { display: none; }
    .digital-file { width: 100%; min-height: 160px; }
    .directory-grid { grid-template-columns: 1fr; }
    .portal-search { margin: -10px auto 30px; }
}
