/* --- CSS VARIABLES & RESET --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-sec: #64748b;
    --border: #e2e8f0;
    --accent: #0f172a;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --modal-bg: rgba(15, 23, 42, 0.6);
    --note-bg: #fffbeb;
    --note-text: #92400e;
    --note-border: #f59e0b;
}

/* --- DARK MODE OVERRIDES --- */
body.dark-mode {
    --bg: #0f172a;
    --surface: #1e293b;
    --text-main: #f1f5f9;
    --text-sec: #94a3b8;
    --border: #334155;
    --accent: #f8fafc;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --modal-bg: rgba(0, 0, 0, 0.8);
    --note-bg: #2d2a1e;
    --note-text: #fbbf24;
    --note-border: #b45309;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* --- HEADER (Modern & Responsive Grid) --- */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.brand-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Brand / Logo Area */
.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.brand-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

/* Theme Toggle Button */
.header-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Search Bar Area */
.search-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    padding-left: 48px;
    padding-right: 50px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-input {
    background-color: var(--surface);
    color: var(--text-main);
    border: 2px solid var(--border);
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body.dark-mode .search-input:focus {
    background-color: var(--bg);
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    font-size: 1.1rem;
}

.clear-search {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-search:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.1);
}

/* --- CATEGORY NAVIGATION --- */
.category-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    width: 100%;
    display: flex;
    align-items: center;
}

.nav-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-sec);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.2s;
    flex-shrink: 0;
}

.cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* --- MAIN EXPLORER GRID --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.stats {
    font-size: 0.9rem;
    color: var(--text-sec);
}

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

/* --- PATH CARDS --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    line-height: 1.3;
}

.module-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.tag-login {
    background: #fae8ff;
    color: #86198f;
}

.tag-purchase {
    background: #ffedd5;
    color: #9a3412;
}

.tag-accounts {
    background: hsl(65, 40%, 88%);
    color: #869700;
}

.tag-other-sop {
    background: hsl(141, 84%, 93%);
    color: #15803d;
}

.path-display {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.step {
    display: inline-flex;
    align-items: center;
}

.step:not(:last-child)::after {
    content: "→";
    margin-left: 6px;
    color: var(--text-sec);
    font-weight: bold;
}

.card-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-sec);
}

.click-hint {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .click-hint {
    opacity: 1;
}

/* --- FOOTER --- */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-sec);
    font-size: 0.9rem;
    margin-top: auto;
}

/* --- MODAL (POPUP) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 950px;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-sec);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-body {
    background: var(--bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.modal-path {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.6;
    word-break: break-word;
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.modal-description {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.7;
    display: none;
}

.modal-note {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--note-bg);
    border-left: 5px solid var(--note-border);
    color: var(--note-text);
    border-radius: 6px;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
}

.modal-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-close {
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-close:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.btn-copy {
    background: var(--primary);
    color: white;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

/* --- RESPONSIVE MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .brand-container {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand actions"
            "search search";
        gap: 1rem;
        padding: 0 1rem;
    }

    .brand {
        grid-area: brand;
    }

    .header-actions {
        grid-area: actions;
    }

    .search-area {
        grid-area: search;
        margin-top: 0.5rem;
    }

    .brand-logo {
        width: 65px;
        height: 65px;
    }

    .brand-text h1 {
        font-size: 1.2rem;
    }

    .brand-text h3 {
        font-size: 0.9rem;
    }

    .nav-inner {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }

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

    .card {
        padding: 1.25rem;
    }

    .search-input {
        padding: 12px 20px;
        padding-left: 40px;
        padding-right: 40px;
    }

    .search-icon {
        left: 12px;
    }

    .clear-search {
        right: 12px;
    }

    .modal-content {
        padding: 1.5rem;
        width: 100%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-path {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .modal-description,
    .modal-note {
        font-size: 0.95rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .btn {
        max-width: 100%;
        width: 100%;
    }
}

/* --- IMPRESSIVE PROFESSIONAL FOOTER --- */
.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-main);
    margin-top: auto;
    /* Pushes footer to the bottom of the page */
    font-size: 0.95rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.footer-top {
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    /* Assigns space to columns */
    gap: 3rem;
}

/* Brand Column */
.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.25rem;
}

.footer-logo {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.footer-brand-text h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.footer-brand-text span {
    font-size: 0.75rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.footer-desc {
    color: var(--text-sec);
    line-height: 1.7;
    max-width: 350px;
}

/* Headings */
.footer-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.5rem;
    position: relative;
}

/* Beautiful underline accent for headings */
.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Quick Links Column */
/* Ensure all columns align their content to the left */
.footer-col {
    text-align: left;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    /* Forces the list items to start from the left */
}

.footer-links li {
    margin-bottom: 0.85rem;
}

.footer-links a {
    color: var(--text-sec);
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(6px);
    /* Smooth slide effect on hover */
}

/* Contact Column */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.2rem;
    color: var(--text-sec);
    line-height: 1.5;
}

.contact-info .icon {
    font-size: 1.2rem;
    line-height: 1.2;
    opacity: 0.8;
}

.contact-info a {
    color: var(--text-sec);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-info a:hover {
    color: var(--primary);
}

/* Bottom Bar */
.footer-bottom {
    background-color: rgba(0, 0, 0, 0.02);
    /* Slight contrast from main footer body */
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

body.dark-mode .footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
}

.bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-template-columns: none;
    /* Disables grid for bottom bar */
}

.bottom-container p {
    margin: 0;
    color: var(--text-sec);
    font-size: 0.9rem;
}

.developer-credit strong {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- MOBILE RESPONSIVENESS FOR FOOTER --- */
@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        /* Drops to 2 columns on tablets */
    }
}

@media (max-width: 768px) {
    .footer-top {
        padding: 3rem 1.5rem 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        /* Drops to 1 column on phones */
        gap: 2.5rem;
    }

    .footer-desc {
        max-width: 100%;
    }

    .bottom-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}