
/* ==========================================
   PROFESSIONAL DOCUMENTATION PAGE
   File: static/css/docs.css
   ========================================== */

/* ==========================================
   1. DOCUMENTATION PAGE BASE
   ========================================== */

.docs-page {
    --docs-primary: #4e38d9;
    --docs-text: #172746;
    --docs-muted: #65738f;
    --docs-border: #e1e8f5;

    min-height: 100vh;
    padding-bottom: 25px;
    background: #f5f8fe;
    color: var(--docs-text);
    font-family: inherit;
}

.docs-page *,
.docs-page *::before,
.docs-page *::after {
    box-sizing: border-box;
}

/* ==========================================
   2. HERO SECTION
   ========================================== */

.docs-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
    min-height: 285px;
    padding: 48px max(6%, calc((100% - 1380px) / 2));
    overflow: hidden;
    background: linear-gradient(
        115deg,
        #111b37 0%,
        #1b2c65 65%,
        #302078 100%
    );
    color: #fff;
}

.docs-hero::before,
.docs-hero::after {
    position: absolute;
    z-index: -1;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.docs-hero::before {
    top: -150px;
    left: 35%;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-hero::after {
    right: 20%;
    bottom: -210px;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.docs-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.docs-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
    color: #dedaff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.docs-eyebrow-line {
    width: 35px;
    height: 4px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #a794ff;
}

.docs-hero h1 {
    margin: 0 0 15px;
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.4px;
}

.docs-hero h1 span {
    color: #aa99ff;
}

.docs-hero-inner > p {
    max-width: 620px;
    margin: 0;
    color: #d2dcf5;
    font-size: 1.02rem;
    line-height: 1.8;
}

.docs-hero-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 17px;
    margin-top: 24px;
}

.docs-hero-topics span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e1e7ff;
    font-size: 0.8rem;
}

.docs-hero-topics i {
    color: #a99aff;
    font-size: 1rem;
}

/* ==========================================
   3. HERO ILLUSTRATION
   ========================================== */

.docs-hero-art {
    position: relative;
    flex: 0 0 310px;
    height: 215px;
}

.docs-art-orb {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(140deg, #2d4799, #34217e);
    opacity: 0.65;
}

.docs-art-window {
    position: absolute;
    z-index: 2;
    top: 28px;
    right: 12px;
    width: 245px;
    height: 155px;
    padding: 12px;
    border: 1px solid #7b91ff;
    border-radius: 12px;
    background: linear-gradient(145deg, #293d85, #151f48);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
    transform: rotate(-4deg);
    transition: transform 0.3s ease;
}

.docs-hero-art:hover .docs-art-window {
    transform: rotate(0deg) translateY(-3px);
}

.docs-art-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
}

.docs-art-toolbar span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9eacff;
}

.docs-art-content {
    display: flex;
    gap: 12px;
    height: 100px;
}

.docs-art-sidebar {
    display: flex;
    flex: 0 0 52px;
    flex-direction: column;
    gap: 9px;
    padding: 9px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
}

.docs-art-sidebar span {
    height: 4px;
    border-radius: 4px;
    background: #667fe0;
}

.docs-art-code {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
}

.docs-art-code span {
    width: 80%;
    height: 4px;
    border-radius: 4px;
    background: #9c9bff;
}

.docs-art-code span:nth-child(even) {
    width: 55%;
    background: #62bde9;
}

.docs-art-base {
    position: absolute;
    bottom: -12px;
    left: -9px;
    width: 260px;
    height: 10px;
    border-radius: 3px 3px 12px 12px;
    background: linear-gradient(90deg, #8295ff, #4934c8);
}

.docs-art-book {
    position: absolute;
    z-index: 3;
    right: -3px;
    bottom: 8px;
    display: grid;
    width: 55px;
    height: 45px;
    place-items: center;
    border: 2px solid #9c8bff;
    border-radius: 7px;
    background: #4536a9;
    color: #fff;
    font-size: 1.3rem;
    transform: rotate(-8deg);
}

.docs-art-code-icon {
    position: absolute;
    z-index: 3;
    top: 4px;
    left: 0;
    display: grid;
    width: 55px;
    height: 48px;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #6089ff, #6241d9);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    transform: rotate(-8deg);
}

/* ==========================================
   4. MAIN CONTAINER
   ========================================== */

.docs-container {
    width: min(1380px, 88%);
    margin: 0 auto;
}

/* ==========================================
   5. SECTION HEADING
   ========================================== */

.docs-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 40px 0 24px;
}

.docs-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    color: var(--docs-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.docs-section-label > span {
    width: 30px;
    height: 4px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #a18aff;
}

.docs-section-heading h2 {
    margin: 0 0 9px;
    color: var(--docs-text);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.7px;
}

.docs-section-heading p {
    max-width: 680px;
    margin: 0;
    color: var(--docs-muted);
    font-size: 0.93rem;
    line-height: 1.8;
}

.docs-count {
    flex-shrink: 0;
    padding: 9px 12px;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    background: #fff;
    color: #68748c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ==========================================
   6. DOCUMENTATION GRID
   ========================================== */

.doc-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* ==========================================
   7. DOCUMENTATION CARD
   ========================================== */

.docs-page .doc-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--docs-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(35, 53, 95, 0.035);
    transition:
        transform 0.23s ease,
        box-shadow 0.23s ease,
        border-color 0.23s ease;
}

.docs-page .doc-card:hover {
    transform: translateY(-4px);
    border-color: #c7bcff;
    box-shadow: 0 14px 30px rgba(40, 48, 100, 0.09);
}

.doc-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.docs-page .doc-icon {
    display: grid;
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 15px;
    background: #e9efff;
    color: #3467e8;
    font-size: 1.35rem;
}

.doc-arrow {
    color: #a1b8ef;
    font-size: 1.6rem;
    transition: transform 0.2s ease;
}

.docs-page .doc-card:hover .doc-arrow {
    transform: translate(3px, -3px);
}

.doc-card-content {
    flex: 1;
}

.doc-category {
    margin-bottom: 8px;
    color: var(--docs-primary);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.docs-page .doc-card h3 {
    margin: 0 0 9px;
    color: #172746;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.4;
}

.docs-page .doc-card p {
    margin: 0;
    color: #687590;
    font-size: 0.87rem;
    line-height: 1.75;
}

/* ==========================================
   8. CARD TAGS
   ========================================== */

.doc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.doc-tags span {
    padding: 6px 9px;
    border-radius: 6px;
    background: #edf2ff;
    color: #345cae;
    font-size: 0.68rem;
    font-weight: 600;
}

/* ==========================================
   9. CATEGORY COLORS
   ========================================== */

.docs-page .doc-sql .doc-icon {
    background: #e5edff;
    color: #2865ee;
}

.docs-page .doc-sql .doc-link {
    background: #2d60ed;
}

.docs-page .doc-cmd .doc-icon {
    background: #e9edf5;
    color: #172746;
}

.docs-page .doc-cmd .doc-link {
    background: #172746;
}

.docs-page .doc-insurance .doc-icon {
    background: #ddf7ef;
    color: #079b83;
}

.docs-page .doc-insurance .doc-link {
    background: #079b83;
}

.docs-page .doc-git .doc-icon {
    background: #eee5ff;
    color: #7040df;
}

.docs-page .doc-git .doc-link {
    background: #6536dc;
}

.docs-page .doc-python .doc-icon {
    background: #e3efff;
    color: #1d74c9;
}

.docs-page .doc-python .doc-link {
    background: #1670e9;
}

.docs-page .doc-portfolio .doc-icon {
    background: #ffe6ed;
    color: #e94370;
}

.docs-page .doc-portfolio .doc-link {
    background: #e94370;
}

/* ==========================================
   10. CARD LINKS
   ========================================== */

.docs-page .doc-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        filter 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.docs-page .doc-link > span {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.docs-page .doc-link:hover {
    filter: brightness(0.92);
    box-shadow: 0 5px 14px rgba(35, 45, 100, 0.15);
    color: #fff;
}

.docs-page .doc-link:hover > span {
    transform: translateX(3px);
}

.docs-page .doc-link:focus-visible {
    outline: 3px solid #b9aaff;
    outline-offset: 3px;
}

/* Keyboard focus for cards that are links */

.docs-page .doc-card:focus-within {
    outline: 2px solid #a18aff;
    outline-offset: 3px;
}

/* ==========================================
   11. FOOTER
   ========================================== */

.docs-footer {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 36px 0 8px;
}

.docs-footer > span {
    flex: 1;
    height: 1px;
    background: #dbe3f2;
}

.docs-footer p {
    margin: 0;
    color: #8190ad;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-align: center;
    white-space: nowrap;
}

.docs-footer b {
    margin: 0 7px;
    color: #6449e9;
}

/* ==========================================
   12. LARGE SCREENS
   ========================================== */

@media (min-width: 1500px) {
    .docs-hero {
        padding-right: max(6%, calc((100% - 1380px) / 2));
        padding-left: max(6%, calc((100% - 1380px) / 2));
    }

    .docs-page .doc-card {
        padding: 26px;
    }

    .doc-list {
        gap: 24px;
    }
}

/* ==========================================
   13. TABLET
   ========================================== */

@media (max-width: 1000px) {
    .docs-hero {
        padding: 42px 6%;
    }

    .docs-hero-art {
        flex-basis: 250px;
        transform: scale(0.9);
        transform-origin: right center;
    }

    .doc-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .docs-container {
        width: 90%;
    }
}

/* ==========================================
   14. SMALL TABLET
   ========================================== */

@media (max-width: 800px) {
    .docs-hero {
        gap: 10px;
    }

    .docs-hero-inner {
        max-width: 100%;
    }

    .docs-hero-art {
        flex-basis: 210px;
        transform: scale(0.78);
        transform-origin: right center;
        margin-left: -20px;
    }

    .docs-section-heading {
        padding-top: 34px;
    }
}

/* ==========================================
   15. MOBILE
   ========================================== */

@media (max-width: 650px) {
    .docs-hero {
        min-height: auto;
        padding: 38px 6%;
    }

    .docs-hero h1 {
        font-size: 2.2rem;
        letter-spacing: -0.8px;
    }

    .docs-hero-inner > p {
        font-size: 0.93rem;
    }

    .docs-hero-art {
        display: none;
    }

    .docs-hero-topics {
        gap: 13px 17px;
    }

    .docs-container {
        width: 90%;
    }

    .docs-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding-top: 32px;
    }

    .docs-section-heading p {
        font-size: 0.9rem;
    }

    .doc-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .docs-page .doc-card {
        padding: 20px;
    }

    .docs-page .doc-link {
        align-self: stretch;
    }

    .docs-footer {
        gap: 10px;
    }

    .docs-footer p {
        font-size: 0.58rem;
        letter-spacing: 1px;
    }
}

/* ==========================================
   16. EXTRA SMALL MOBILE
   ========================================== */

@media (max-width: 380px) {
    .docs-hero h1 {
        font-size: 1.9rem;
    }

    .docs-eyebrow {
        font-size: 0.65rem;
        letter-spacing: 1.3px;
    }

    .docs-hero-topics {
        flex-direction: column;
        gap: 10px;
    }

    .docs-page .doc-card {
        padding: 17px;
    }

    .docs-page .doc-card h3 {
        font-size: 1.1rem;
    }

    .docs-footer p {
        white-space: normal;
    }
}

/* ==========================================
   17. DARK MODE
   ========================================== */

body.dark-mode .docs-page {
    --docs-text: #edf0ff;
    --docs-muted: #aab5ce;
    --docs-border: #29334d;

    background: #0f1425;
    color: #edf0ff;
}

body.dark-mode .docs-section-heading h2 {
    color: #edf0ff;
}

body.dark-mode .docs-section-heading p {
    color: #aab5ce;
}

body.dark-mode .docs-count {
    border-color: #303853;
    background: #181f34;
    color: #d5dcf0;
}

body.dark-mode .docs-page .doc-card {
    border-color: #29334d;
    background: #181f34;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

body.dark-mode .docs-page .doc-card:hover {
    border-color: #6557ad;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

body.dark-mode .docs-page .doc-card h3 {
    color: #edf0ff;
}

body.dark-mode .docs-page .doc-card p {
    color: #b0bbd2;
}

body.dark-mode .docs-page .doc-tags span {
    background: #252e49;
    color: #cbd5ff;
}

body.dark-mode .docs-footer > span {
    background: #303853;
}

body.dark-mode .docs-footer p {
    color: #9daac7;
}

body.dark-mode .docs-page .doc-count {
    background: #181f34;
}

/* ==========================================
   18. ACCESSIBILITY
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .docs-page *,
    .docs-page *::before,
    .docs-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .docs-page .doc-card:hover,
    .docs-hero-art:hover .docs-art-window {
        transform: none;
    }
}
