/* ============================================
   EDVANCE MEDIA — Works / Portfolio Page
   ============================================ */

/* --- Hero --- */
.works-hero {
    position: relative; min-height: 60vh; display: flex;
    align-items: center; padding-top: 72px; overflow: hidden;
    background: var(--gradient-soft);
}
.works-hero__bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(79,70,229,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(124,58,237,0.05) 0%, transparent 50%);
}
.works-hero__content {
    position: relative; z-index: 2; text-align: center;
    max-width: 700px; margin: 0 auto; padding: 60px 0;
}
.works-hero__badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 20px; border-radius: var(--radius-full);
    background: rgba(79,70,229,0.08); border: 1px solid rgba(79,70,229,0.15);
    font-size: 0.85rem; font-weight: 600; color: var(--primary);
    margin-bottom: 24px;
}
.works-hero h1 { margin-bottom: 20px; }
.works-hero h1 .text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.works-hero__subtitle {
    color: var(--text-secondary); font-size: 1.15rem; line-height: 1.7;
    max-width: 560px; margin: 0 auto;
}

/* --- Showcase (horizontal scrolling cards) --- */
.works-showcase {
    padding: 40px 0 80px;
    overflow: hidden;
    position: relative;
}
.works-showcase--home {
    padding: 20px 0 40px;
}
.works-showcase::before,
.works-showcase::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none;
}
.works-showcase::before { left: 0; background: linear-gradient(90deg, var(--bg) 0%, transparent 100%); }
.works-showcase::after { right: 0; background: linear-gradient(-90deg, var(--bg) 0%, transparent 100%); }

.showcase-row {
    display: flex; gap: 24px;
    padding: 12px 0;
    will-change: transform;
}
.showcase-row--left { animation: scrollLeft 40s linear infinite; }
.showcase-row--right { animation: scrollRight 40s linear infinite; }
.showcase-row--slow { animation-duration: 55s; }

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes scrollRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.showcase-row:hover { animation-play-state: paused; }

/* --- Showcase Cards Base --- */
.showcase-card {
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
    transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
    cursor: default;
}
.showcase-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 60px rgba(79,70,229,0.12);
    border-color: var(--primary-light);
}

/* --- Browser Card --- */
.showcase-card--browser { width: 320px; }
.sc-browser__bar {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.sc-browser__bar > span {
    width: 10px; height: 10px; border-radius: 50%;
}
.sc-browser__bar > span:nth-child(1) { background: #EF4444; }
.sc-browser__bar > span:nth-child(2) { background: #F59E0B; }
.sc-browser__bar > span:nth-child(3) { background: #10B981; }
.sc-browser__url {
    margin-left: 12px; font-size: 0.7rem; color: var(--text-light);
    background: var(--bg); padding: 3px 10px; border-radius: 4px; flex: 1;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-browser__body { padding: 16px; min-height: 160px; }

/* --- UI elements inside browser --- */
.sc-ui__nav {
    height: 8px; background: var(--border); border-radius: 4px; margin-bottom: 16px; width: 60%;
}
.sc-ui__hero-block { margin-bottom: 16px; }
.sc-ui__text-xl { height: 14px; width: 80%; background: var(--text-light); opacity: 0.15; border-radius: 3px; margin-bottom: 8px; }
.sc-ui__text-lg { height: 12px; width: 70%; background: var(--text-light); opacity: 0.15; border-radius: 3px; margin-bottom: 6px; }
.sc-ui__text-sm { height: 8px; width: 90%; background: var(--text-light); opacity: 0.1; border-radius: 3px; margin-bottom: 10px; }
.sc-ui__btn {
    width: 60px; height: 22px; border-radius: 6px;
    background: var(--primary); opacity: 0.7;
}
.sc-ui__btn--ghost {
    background: transparent; border: 1.5px solid var(--primary); opacity: 0.5;
}
.sc-ui__btn-row { display: flex; gap: 8px; }
.sc-ui__grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-ui__grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sc-ui__card-img {
    height: 48px; border-radius: 6px;
    background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(124,58,237,0.08));
}
.sc-ui__product {
    height: 64px; border-radius: 6px;
    background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(124,58,237,0.04));
    border: 1px solid var(--border);
}
.sc-ui__hero-full { text-align: center; padding: 20px 0 16px; }
.sc-ui__features-row { display: flex; gap: 12px; justify-content: center; }
.sc-ui__feature-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(79,70,229,0.08); border: 1px solid rgba(79,70,229,0.12);
}

/* Dashboard */
.sc-ui__dashboard { display: flex; gap: 8px; margin-bottom: 12px; }
.sc-ui__stat-card {
    flex: 1; padding: 10px; border-radius: 8px;
    background: rgba(79,70,229,0.05); border: 1px solid rgba(79,70,229,0.1);
}
.sc-ui__stat-num { height: 12px; width: 50%; background: var(--primary); opacity: 0.2; border-radius: 3px; margin-bottom: 4px; }
.sc-ui__stat-label { height: 6px; width: 70%; background: var(--text-light); opacity: 0.1; border-radius: 3px; }
.sc-ui__chart-area {
    height: 60px; border-radius: 8px;
    background: linear-gradient(180deg, rgba(79,70,229,0.08) 0%, rgba(79,70,229,0.02) 100%);
    border: 1px solid rgba(79,70,229,0.08);
}

/* Table */
.sc-ui__table { }
.sc-ui__table-head { height: 8px; background: var(--primary); opacity: 0.1; border-radius: 3px; margin-bottom: 6px; }
.sc-ui__table-row { height: 10px; background: var(--text-light); opacity: 0.06; border-radius: 3px; margin-bottom: 5px; }

/* --- Code Card --- */
.showcase-card--code { width: 300px; }
.sc-code__bar {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; background: #1E1E2E; border-bottom: 1px solid #2D2D3D;
}
.sc-code__bar > span {
    width: 10px; height: 10px; border-radius: 50%;
}
.sc-code__bar > span:nth-child(1) { background: #EF4444; }
.sc-code__bar > span:nth-child(2) { background: #F59E0B; }
.sc-code__bar > span:nth-child(3) { background: #10B981; }
.sc-code__body {
    padding: 14px; background: #1E1E2E; font-family: 'Courier New', monospace;
    font-size: 0.72rem; line-height: 1.7;
}
.sc-code__line { color: #A6ADC8; white-space: nowrap; }
.sc-kw { color: #CBA6F7; }
.sc-fn { color: #89B4FA; }
.sc-str { color: #A6E3A1; }
.sc-num { color: #FAB387; }
.sc-cm { color: #585B70; }

/* --- Terminal Card --- */
.showcase-card--terminal { width: 300px; }
.sc-terminal__body {
    padding: 14px; background: #0F0F17; font-family: 'Courier New', monospace;
    font-size: 0.72rem; line-height: 1.8;
}
.sc-terminal__line { color: #A6ADC8; white-space: nowrap; }
.sc-terminal__prompt { color: #10B981; font-weight: 700; }
.sc-terminal__output { color: #585B70; }
.sc-terminal__cursor { animation: blink 1s step-end infinite; color: #A6ADC8; }
@keyframes blink { 50% { opacity: 0; } }

/* --- Wireframe Card --- */
.showcase-card--wireframe { width: 260px; }
.sc-wire__label {
    padding: 10px 14px; font-size: 0.7rem; font-weight: 600;
    color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border); background: var(--bg-alt);
}
.sc-wire__body {
    padding: 14px; display: grid;
    grid-template-columns: 60px 1fr; grid-template-rows: 20px 1fr;
    gap: 8px; min-height: 140px;
}
.sc-wire__header {
    grid-column: 1 / -1; background: var(--border); border-radius: 3px;
}
.sc-wire__sidebar { display: flex; flex-direction: column; gap: 6px; }
.sc-wire__menu-item { height: 8px; background: var(--border); border-radius: 3px; opacity: 0.6; }
.sc-wire__menu-item--active { opacity: 1; background: var(--primary); }
.sc-wire__content { display: flex; flex-direction: column; gap: 8px; }
.sc-wire__chart {
    height: 40px; border-radius: 4px;
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(124,58,237,0.05));
    border: 1px dashed var(--border);
}
.sc-wire__table { display: flex; flex-direction: column; gap: 4px; }
.sc-wire__row { height: 8px; background: var(--border); border-radius: 2px; opacity: 0.5; }

.sc-wire__body--form {
    display: flex; flex-direction: column; gap: 10px;
    grid-template-columns: unset; grid-template-rows: unset;
}
.sc-wire__input { height: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; }
.sc-wire__input--area { height: 40px; }
.sc-wire__submit { height: 20px; background: var(--primary); opacity: 0.5; border-radius: 4px; width: 80px; }

/* --- Mobile Card --- */
.showcase-card--mobile {
    width: 140px; border-radius: 20px;
    border: 2px solid var(--border); padding: 0;
    background: var(--bg-card); position: relative;
}
.sc-mobile__notch {
    width: 50px; height: 6px; background: var(--border);
    border-radius: 0 0 8px 8px; margin: 0 auto;
}
.sc-mobile__body { padding: 10px; min-height: 200px; display: flex; flex-direction: column; }
.sc-mobile__header { height: 10px; background: var(--border); border-radius: 3px; margin-bottom: 10px; width: 60%; }
.sc-mobile__card {
    height: 40px; border-radius: 8px; margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(124,58,237,0.05));
    border: 1px solid var(--border);
}
.sc-mobile__card--wide { height: 50px; }
.sc-mobile__card--bottom { margin-top: auto; height: 50px; }
.sc-mobile__map {
    flex: 1; border-radius: 8px; margin-bottom: 8px; min-height: 80px;
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(79,70,229,0.05));
    border: 1px solid var(--border);
}
.sc-mobile__tab-bar {
    display: flex; gap: 6px; justify-content: center; padding-top: 8px;
    border-top: 1px solid var(--border);
}
.sc-mobile__tab-bar span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border);
}
.sc-mobile__tab-bar span.active { background: var(--primary); }

/* --- Diagram Card --- */
.showcase-card--diagram { width: 320px; }
.sc-diagram__label {
    padding: 10px 14px; font-size: 0.7rem; font-weight: 600;
    color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border); background: var(--bg-alt);
}
.sc-diagram__body {
    display: flex; align-items: center; gap: 6px;
    padding: 14px; flex-wrap: wrap; justify-content: center;
}
.sc-diagram__body--row2 { padding-top: 0; }
.sc-diagram__node {
    padding: 6px 12px; border-radius: 6px; font-size: 0.7rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--bg);
}
.sc-diagram__node--client { border-color: #10B981; color: #10B981; }
.sc-diagram__node--nginx { border-color: #10B981; color: #10B981; }
.sc-diagram__node--app { border-color: var(--primary); color: var(--primary); }
.sc-diagram__node--db { border-color: #F59E0B; color: #F59E0B; }
.sc-diagram__node--cache { border-color: #EF4444; color: #EF4444; }
.sc-diagram__node--queue { border-color: #8B5CF6; color: #8B5CF6; }
.sc-diagram__node--worker { border-color: #06B6D4; color: #06B6D4; }
.sc-diagram__arrow { color: var(--text-light); font-size: 0.9rem; }

/* Flow diagram */
.sc-flow { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sc-flow__step {
    padding: 5px 14px; border-radius: 6px; font-size: 0.7rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary);
}
.sc-flow__step--sm { font-size: 0.65rem; padding: 4px 10px; }
.sc-flow__step--accent { border-color: var(--primary); color: var(--primary); }
.sc-flow__step--success { border-color: #10B981; color: #10B981; background: rgba(16,185,129,0.05); }
.sc-flow__arrow { color: var(--text-light); font-size: 0.8rem; }
.sc-flow__branch { display: flex; gap: 8px; }

/* --- Stats --- */
.works-stats {
    padding: 60px 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.works-stats__grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
    text-align: center;
}
.works-stats__number {
    font-size: 3rem; font-weight: 800; color: var(--primary);
    line-height: 1; margin-bottom: 8px;
}
.works-stats__label {
    font-size: 0.95rem; color: var(--text-secondary); font-weight: 500;
}

/* --- Categories --- */
.works-categories {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.works-cat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 36px;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.works-cat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--gradient); opacity: 0; transition: opacity var(--transition);
}
.works-cat:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.works-cat:hover::before { opacity: 1; }
.works-cat__icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    background: rgba(79,70,229,0.08); color: var(--primary);
}
.works-cat h3 { margin-bottom: 10px; }
.works-cat p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; }
.works-cat__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.works-cat__tags span {
    padding: 4px 12px; border-radius: var(--radius-full);
    background: rgba(79,70,229,0.06); border: 1px solid rgba(79,70,229,0.12);
    font-size: 0.78rem; font-weight: 500; color: var(--text-secondary);
}

/* --- CTA (reuse from servers.css) --- */
.cta-section {
    background: var(--gradient); padding: 80px 0; text-align: center; color: #fff;
}
.cta-section h2 { color: #fff; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.8); font-size: 1.1rem; max-width: 500px; margin: 0 auto 32px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .works-categories { grid-template-columns: 1fr; }
    .works-stats__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 768px) {
    .works-stats__grid { grid-template-columns: repeat(2, 1fr); }
    .showcase-card--browser { width: 260px; }
    .showcase-card--code { width: 240px; }
    .showcase-card--terminal { width: 240px; }
    .showcase-card--wireframe { width: 220px; }
    .showcase-card--diagram { width: 260px; }
    .showcase-card--mobile { width: 120px; }
}
