/* =========================================================
   CYBERSECURITY TOPICS PAGE
   File: cyber-topic.css
   Shared header and footer remain in style.css
   ========================================================= */

/* ---------- Page variables ---------- */
:root {
    --topic-cyan: #25e6ff;
    --topic-blue: #3d7cff;
    --topic-green: #32ff9a;
    --topic-purple: #9f63ff;
    --topic-dark: #030812;
    --topic-panel: rgba(7, 19, 35, 0.88);
    --topic-panel-light: rgba(11, 28, 48, 0.9);
    --topic-border: rgba(37, 230, 255, 0.28);
    --topic-text: #eaf8ff;
    --topic-muted: #a9bfd0;
    --topic-shadow: 0 0 25px rgba(37, 230, 255, 0.16);
}

/* ---------- Main page foundation ---------- */
main {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--topic-text);
    background:
        radial-gradient(circle at 15% 12%, rgba(61, 124, 255, 0.14), transparent 30%),
        radial-gradient(circle at 88% 35%, rgba(50, 255, 154, 0.09), transparent 27%),
        linear-gradient(180deg, #020710 0%, #06101c 48%, #020710 100%);
}

/* Moving grid layer */
main::before {
    content: "";
    position: absolute;
    inset: -120px;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 230, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 230, 255, 0.07) 1px, transparent 1px);
    background-size: 52px 52px;
    transform: perspective(700px) rotateX(58deg) scale(1.35);
    transform-origin: center top;
    animation: topic-grid-move 15s linear infinite;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 92%);
}

/* Soft moving glow behind content */
main::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    top: 18%;
    left: -220px;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(61, 124, 255, 0.12);
    filter: blur(85px);
    animation: topic-orb-drift 12s ease-in-out infinite alternate;
}

/* ---------- Shared page sections ---------- */
.content-section,
.cybersecurity-call-to-action {
    position: relative;
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.content-section {
    padding: 90px 0;
}

.section-heading {
    width: min(780px, 100%);
    margin: 0 auto 48px;
    text-align: center;
}

.section-heading h2,
.call-to-action-content h2 {
    margin: 10px 0 18px;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    text-shadow: 0 0 24px rgba(37, 230, 255, 0.18);
}

.section-heading > p:last-child,
.call-to-action-content > p:not(.section-label) {
    margin: 0;
    color: var(--topic-muted);
    font-size: 1.04rem;
    line-height: 1.8;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--topic-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-label::before,
.section-label::after {
    content: "";
    width: 25px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* ---------- Hero ---------- */
.topics-hero {
    position: relative;
    min-height: 720px;
    display: grid;
    place-items: center;
    padding: 130px 20px 95px;
    overflow: hidden;
    border-bottom: 1px solid rgba(37, 230, 255, 0.14);
    background:
        linear-gradient(rgba(2, 7, 16, 0.36), rgba(2, 7, 16, 0.94)),
        radial-gradient(circle at 50% 35%, rgba(37, 230, 255, 0.13), transparent 42%);
}

/* Animated digital rings */
.topics-hero::before,
.topics-hero::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.topics-hero::before {
    width: 610px;
    height: 610px;
    border: 1px solid rgba(37, 230, 255, 0.18);
    box-shadow:
        0 0 35px rgba(37, 230, 255, 0.08),
        inset 0 0 35px rgba(37, 230, 255, 0.06);
    animation: topic-ring-pulse 4.5s ease-in-out infinite;
}

.topics-hero::after {
    width: 475px;
    height: 475px;
    border: 1px dashed rgba(50, 255, 154, 0.25);
    animation: topic-ring-spin 25s linear infinite;
}

.topics-hero-content {
    position: relative;
    z-index: 2;
    width: min(900px, 100%);
    padding: 58px 55px;
    text-align: center;
    border: 1px solid rgba(37, 230, 255, 0.3);
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(10, 27, 47, 0.84), rgba(3, 10, 21, 0.88));
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.48),
        0 0 35px rgba(37, 230, 255, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    animation: topic-hero-enter 0.9s ease both;
}

/* Corner scanner marks */
.topics-hero-content::before,
.topics-hero-content::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 72px;
    pointer-events: none;
}

.topics-hero-content::before {
    top: 16px;
    left: 16px;
    border-top: 2px solid var(--topic-cyan);
    border-left: 2px solid var(--topic-cyan);
    border-radius: 13px 0 0 0;
}

.topics-hero-content::after {
    right: 16px;
    bottom: 16px;
    border-right: 2px solid var(--topic-green);
    border-bottom: 2px solid var(--topic-green);
    border-radius: 0 0 13px 0;
}

.topics-hero h1 {
    margin: 16px auto 22px;
    max-width: 850px;
    color: #ffffff;
    font-size: clamp(2.7rem, 7vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-shadow:
        0 0 15px rgba(37, 230, 255, 0.3),
        0 0 45px rgba(61, 124, 255, 0.22);
}

.hero-description {
    max-width: 720px;
    margin: 0 auto;
    color: #b8cad8;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.82;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 34px;
}

/* ---------- Buttons scoped to main ---------- */
main .primary-button,
main .secondary-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 25px;
    overflow: hidden;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-decoration: none;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease;
}

main .primary-button {
    color: #021019;
    border: 1px solid var(--topic-cyan);
    background: linear-gradient(135deg, var(--topic-cyan), var(--topic-green));
    box-shadow:
        0 8px 25px rgba(37, 230, 255, 0.2),
        0 0 18px rgba(37, 230, 255, 0.16);
}

main .secondary-button {
    color: var(--topic-cyan);
    border: 1px solid rgba(37, 230, 255, 0.45);
    background: rgba(6, 17, 31, 0.72);
}

main .primary-button::before,
main .secondary-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 75%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.38),
        transparent
    );
    transform: skewX(-22deg);
    transition: left 0.55s ease;
}

main .primary-button:hover::before,
main .secondary-button:hover::before {
    left: 150%;
}

main .primary-button:hover,
main .secondary-button:hover {
    transform: translateY(-3px);
}

main .primary-button:hover {
    box-shadow:
        0 12px 34px rgba(37, 230, 255, 0.3),
        0 0 26px rgba(50, 255, 154, 0.22);
}

main .secondary-button:hover {
    color: #ffffff;
    border-color: var(--topic-green);
    box-shadow: 0 0 22px rgba(50, 255, 154, 0.14);
}

/* ---------- Topic cards ---------- */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.topic-card {
    position: relative;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
    overflow: hidden;
    border: 1px solid var(--topic-border);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(12, 31, 52, 0.91), rgba(4, 13, 26, 0.94));
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
        transform 0.32s ease,
        border-color 0.32s ease,
        box-shadow 0.32s ease;
}

/* Tiny animated grid inside every topic card */
.topic-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image:
        linear-gradient(rgba(37, 230, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 230, 255, 0.055) 1px, transparent 1px);
    background-size: 26px 26px;
    animation: topic-card-grid 8s linear infinite;
}

/* Hover glow */
.topic-card::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    top: -85px;
    right: -85px;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(37, 230, 255, 0.14);
    filter: blur(6px);
    transform: scale(0.75);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.topic-card:hover {
    transform: translateY(-9px);
    border-color: rgba(50, 255, 154, 0.55);
    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.38),
        0 0 28px rgba(37, 230, 255, 0.14);
}

.topic-card:hover::after {
    opacity: 1;
    transform: scale(1);
}

.topic-card > * {
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border: 1px solid rgba(37, 230, 255, 0.38);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(37, 230, 255, 0.12), rgba(50, 255, 154, 0.06));
    box-shadow:
        0 0 22px rgba(37, 230, 255, 0.12),
        inset 0 0 18px rgba(37, 230, 255, 0.06);
    font-size: 2rem;
    animation: topic-icon-float 3.4s ease-in-out infinite;
}

.topic-card:nth-child(2n) .card-icon {
    animation-delay: -0.7s;
}

.topic-card:nth-child(3n) .card-icon {
    animation-delay: -1.4s;
}

.topic-card h3 {
    margin: 0 0 13px;
    color: #ffffff;
    font-size: 1.33rem;
    letter-spacing: -0.015em;
}

.topic-card p {
    margin: 0 0 26px;
    color: var(--topic-muted);
    line-height: 1.72;
}

.topic-card .primary-button {
    min-height: 43px;
    margin-top: auto;
    padding: 11px 20px;
    font-size: 0.84rem;
}

/* ---------- Learning path ---------- */
.learning-section {
    margin-top: 20px;
    margin-bottom: 100px;
    padding-inline: 50px;
    border: 1px solid rgba(37, 230, 255, 0.2);
    border-radius: 30px;
    background:
        linear-gradient(150deg, rgba(8, 24, 42, 0.9), rgba(3, 11, 23, 0.94));
    box-shadow: var(--topic-shadow);
}

.learning-list {
    position: relative;
    width: min(900px, 100%);
    margin: 0 auto;
}

.learning-list::before {
    content: "";
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 31px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--topic-cyan),
        var(--topic-green),
        var(--topic-purple)
    );
    box-shadow: 0 0 13px rgba(37, 230, 255, 0.5);
}

.learning-item {
    position: relative;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 20px 24px 20px 0;
    border: 1px solid rgba(37, 230, 255, 0.13);
    border-radius: 18px;
    background: rgba(4, 15, 29, 0.66);
    transition:
        transform 0.28s ease,
        border-color 0.28s ease,
        background 0.28s ease;
}

.learning-item:last-child {
    margin-bottom: 0;
}

.learning-item:hover {
    transform: translateX(8px);
    border-color: rgba(50, 255, 154, 0.42);
    background: rgba(8, 25, 43, 0.86);
}

.learning-item > span {
    position: relative;
    z-index: 1;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    color: #03131b;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--topic-cyan), var(--topic-green));
    box-shadow: 0 0 20px rgba(37, 230, 255, 0.28);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.learning-item h3 {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 1.13rem;
}

.learning-item p {
    margin: 0;
    color: var(--topic-muted);
    line-height: 1.65;
}

/* ---------- Call to action ---------- */
.cybersecurity-call-to-action {
    margin-bottom: 110px;
    padding: 78px 30px;
    overflow: hidden;
    border: 1px solid rgba(50, 255, 154, 0.28);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(7, 29, 43, 0.94), rgba(4, 13, 27, 0.96));
    box-shadow:
        0 22px 65px rgba(0, 0, 0, 0.34),
        0 0 30px rgba(50, 255, 154, 0.08);
}

.cybersecurity-call-to-action::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 48%, rgba(37, 230, 255, 0.08) 49% 51%, transparent 52%),
        linear-gradient(transparent 0 48%, rgba(37, 230, 255, 0.08) 49% 51%, transparent 52%);
    background-size: 70px 70px;
    animation: topic-cta-grid 10s linear infinite;
}

.cybersecurity-call-to-action::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -130px;
    top: -130px;
    pointer-events: none;
    border: 1px solid rgba(37, 230, 255, 0.22);
    border-radius: 50%;
    box-shadow:
        0 0 0 38px rgba(37, 230, 255, 0.025),
        0 0 0 75px rgba(50, 255, 154, 0.018);
    animation: topic-ring-spin 24s linear infinite reverse;
}

.call-to-action-content {
    position: relative;
    z-index: 1;
    width: min(820px, 100%);
    margin: 0 auto;
    text-align: center;
}

.call-to-action-content .primary-button {
    margin-top: 28px;
}

/* ---------- Entrance animation ---------- */
.topic-card,
.learning-item {
    animation: topic-rise-in 0.7s ease both;
}

.topic-card:nth-child(2),
.learning-item:nth-child(2) {
    animation-delay: 0.08s;
}

.topic-card:nth-child(3),
.learning-item:nth-child(3) {
    animation-delay: 0.16s;
}

.topic-card:nth-child(4),
.learning-item:nth-child(4) {
    animation-delay: 0.24s;
}

.topic-card:nth-child(5),
.learning-item:nth-child(5) {
    animation-delay: 0.32s;
}

.topic-card:nth-child(6),
.learning-item:nth-child(6) {
    animation-delay: 0.4s;
}

.topic-card:nth-child(7),
.learning-item:nth-child(7) {
    animation-delay: 0.48s;
}

/* ---------- Keyframes ---------- */
@keyframes topic-grid-move {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 0 52px, 52px 0;
    }
}

@keyframes topic-card-grid {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 0 26px, 26px 0;
    }
}

@keyframes topic-cta-grid {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 70px 70px;
    }
}

@keyframes topic-orb-drift {
    from {
        transform: translate3d(0, 0, 0) scale(0.9);
    }
    to {
        transform: translate3d(110vw, 360px, 0) scale(1.15);
    }
}

@keyframes topic-ring-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes topic-ring-pulse {
    0%,
    100% {
        opacity: 0.45;
        transform: translate(-50%, -50%) scale(0.94);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.04);
    }
}

@keyframes topic-icon-float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-7px) rotate(2deg);
    }
}

@keyframes topic-hero-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes topic-rise-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Responsive design ---------- */
@media (max-width: 980px) {
    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topics-hero {
        min-height: 650px;
    }

    .topics-hero::before {
        width: 520px;
        height: 520px;
    }

    .topics-hero::after {
        width: 410px;
        height: 410px;
    }
}

@media (max-width: 700px) {
    .content-section,
    .cybersecurity-call-to-action {
        width: min(100% - 28px, 1180px);
    }

    .content-section {
        padding: 70px 0;
    }

    .topics-hero {
        min-height: auto;
        padding: 95px 14px 72px;
    }

    .topics-hero-content {
        padding: 43px 24px;
        border-radius: 22px;
    }

    .topics-hero h1 {
        font-size: clamp(2.4rem, 13vw, 4rem);
    }

    .topics-hero::before {
        width: 400px;
        height: 400px;
    }

    .topics-hero::after {
        width: 310px;
        height: 310px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons a {
        width: 100%;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .topic-card {
        min-height: 0;
    }

    .learning-section {
        padding-inline: 18px;
        border-radius: 23px;
    }

    .learning-list::before {
        left: 25px;
    }

    .learning-item {
        grid-template-columns: 52px 1fr;
        gap: 15px;
        padding-right: 14px;
    }

    .learning-item > span {
        width: 50px;
        height: 50px;
        font-size: 0.82rem;
    }

    .learning-item:hover {
        transform: translateX(3px);
    }

    .cybersecurity-call-to-action {
        margin-bottom: 75px;
        padding: 62px 22px;
    }
}

@media (max-width: 430px) {
    .topics-hero-content::before,
    .topics-hero-content::after {
        width: 48px;
        height: 48px;
    }

    .section-heading h2,
    .call-to-action-content h2 {
        font-size: 1.85rem;
    }

    .topic-card {
        padding: 25px 22px;
    }

    .section-label {
        font-size: 0.68rem;
        letter-spacing: 0.12em;
    }

    .section-label::before,
    .section-label::after {
        width: 15px;
    }
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
    main::before,
    main::after,
    .topics-hero::before,
    .topics-hero::after,
    .topic-card::before,
    .cybersecurity-call-to-action::before,
    .cybersecurity-call-to-action::after,
    .card-icon,
    .topics-hero-content,
    .topic-card,
    .learning-item {
        animation: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}
