/* ============================================
   It's Me - Shared Styles
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --green: #22c55e;
    --green-dark: #16a34a;
    --green-light: #4ade80;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #27272a;
    --red: #ef4444;
    --orange: #f97316;
    --purple: #8b5cf6;
    --blue: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

strong {
    color: var(--text-primary);
}

code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--green);
}

/* ============================================
   Header & Navigation
   ============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--green);
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

nav a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--green);
    color: #000;
}

.btn-primary:hover {
    background: var(--green-dark);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    text-decoration: none;
}

/* ============================================
   Containers
   ============================================ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Common Components
   ============================================ */

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 100px;
    font-size: 13px;
    color: var(--green);
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Info Boxes */
.info-box {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.info-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 10px;
}

.info-box p {
    margin-bottom: 0;
}

.warning-box {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
}

.warning-box .info-box-title {
    color: var(--orange);
}

.highlight-box {
    background: var(--bg-card);
    border: 1px solid var(--green);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.highlight-box p {
    color: var(--green);
    font-weight: 500;
    margin: 0;
}

.important-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

.important-box p {
    color: #fca5a5;
    margin: 0;
}

.important-box strong {
    color: var(--red);
}

/* Code Blocks */
.code-block {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.code-block .comment { color: var(--text-muted); }
.code-block .keyword { color: var(--purple); }
.code-block .function { color: var(--blue); }
.code-block .string { color: var(--green); }
.code-block .number { color: var(--orange); }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-card);
}

td {
    color: var(--text-secondary);
}

/* Diagrams */
.diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin: 24px 0;
    text-align: center;
}

.diagram-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.flow-item {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    min-width: 100px;
}

.flow-item.highlight {
    border-color: var(--green);
    background: rgba(34, 197, 94, 0.1);
}

.flow-item-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.flow-item-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.flow-arrow {
    color: var(--text-muted);
}

/* ============================================
   Legal Pages (Privacy, Terms)
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    margin-bottom: 40px;
    font-size: 14px;
}

.last-updated {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 40px;
}

.legal-caps {
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* ============================================
   Footer Styles
   ============================================ */

/* Main site footer (index.html) */
footer.site-footer {
    padding: 60px 24px 30px;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-legal a:hover {
    color: var(--text-secondary);
}

/* Simple footer (legal pages) */
footer.simple-footer {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

footer.simple-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

footer.simple-footer .footer-links a {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Doc page footer (how-it-works) */
footer.doc-footer {
    padding: 40px 24px 20px;
    border-top: 1px solid var(--border);
}

footer.doc-footer .footer-content {
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: var(--green);
}

.footer-text {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.modal h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    nav {
        display: none;
    }

    .footer-main {
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .section-header h2 {
        font-size: 32px;
    }
}
