/* Modern Professional Portfolio Theme */
:root {
    /* Brand Colors */
    --primary: #722f37;
    --primary-light: #8b3a44;
    --primary-dark: #4a1e23;
    --accent: #d4af37; /* Gold */
    --accent-glow: rgba(212, 175, 55, 0.25);

    /* Backgrounds (Dark) */
    --bg-body: #0b1020;
    --bg-surface: #141b2d;
    --bg-surface-2: #1b253b;
    --bg-surface-hover: #202b45;
    --bg-gradient: radial-gradient(circle at top right, rgba(114, 47, 55, 0.18), transparent 45%),
                   radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.8), transparent 45%);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Borders & Shadows */
    --border-color: rgba(148, 163, 184, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 18px rgba(114, 47, 55, 0.35);
    --focus-ring: 0 0 0 3px rgba(212, 175, 55, 0.35);
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"] {
    --bg-body: #f7f7fb;
    --bg-surface: #ffffff;
    --bg-surface-2: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --bg-gradient: radial-gradient(circle at top right, rgba(114, 47, 55, 0.08), transparent 50%),
                   radial-gradient(circle at bottom left, rgba(148, 163, 184, 0.25), transparent 50%);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --border-color: rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 28px 48px rgba(15, 23, 42, 0.18);
    --shadow-glow: 0 0 16px rgba(114, 47, 55, 0.2);
}

html, body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #fcd34d;
}

a:focus-visible,
button:focus-visible,
.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Layout */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-gradient), var(--bg-body);
}

.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Navigation */
.nav-menu {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-brand span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 6rem 1rem;
    background: linear-gradient(180deg, rgba(114, 47, 55, 0.1) 0%, transparent 100%);
    border-radius: 0 0 50% 50% / 4rem;
    margin-bottom: 4rem;
}

.hero-section img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 0 30px rgba(114, 47, 55, 0.4);
    margin-bottom: 2rem;
    object-fit: cover;
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--primary);
    opacity: 0.2;
    z-index: -1;
    transform: skewX(-10deg);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: inline-block;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 47, 55, 0.6);
    color: white;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

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

/* Footer */
.footer {
    background: var(--bg-surface);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Utilities */
hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .nav-menu { flex-direction: column; gap: 1rem; }
    .nav-actions { flex-direction: column; gap: 0.75rem; }
    .nav-links { gap: 1rem; flex-wrap: wrap; justify-content: center; }
}

/* Skill meter styles */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.skill-row {
    display: grid;
    grid-template-columns: 1fr 120px 50px;
    gap: 1rem;
    align-items: center;
    margin: 0.6rem 0;
}

.skill-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.skill-meter {
    height: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.03);
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    box-shadow: 0 4px 12px rgba(114,47,55,0.25) inset;
    transition: width 0.6s cubic-bezier(.2,.9,.2,1);
}

.skill-percent {
    text-align: right;
    font-weight: 600;
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .skill-row { grid-template-columns: 1fr 90px 40px; }
}

/* Screen-reader only helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   Guides / Knowledge Base Page Styles
   ============================================ */

.guides-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.guides-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.guides-header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guides-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.breadcrumb-link {
    color: var(--accent);
    font-weight: 500;
    transition: all 0.2s ease;
}

.breadcrumb-link:hover {
    color: #fcd34d;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 300;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Contents Grid - Folders and Files */
.contents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.content-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
}

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

.folder-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.card-icon {
    font-size: 2rem;
    line-height: 1;
}

.card-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.file-size {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-message {
    text-align: center;
    padding: 2rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 0.75rem;
    color: #fca5a5;
}

.btn-retry {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-retry:hover {
    background: var(--primary-light);
}

.empty-folder {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-style: italic;
}

/* Markdown Content Styling */
.markdown-body {
    background: var(--bg-surface);
    padding: 2rem 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    line-height: 1.8;
    color: var(--text-secondary);
}

.markdown-body,
.markdown-body * {
    color: inherit;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: var(--text-primary);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-body h1 { font-size: 2rem; }
.markdown-body h2 { font-size: 1.6rem; }
.markdown-body h3 { font-size: 1.3rem; }

.markdown-body p {
    margin: 1em 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin: 1em 0;
}

.markdown-body li {
    margin: 0.5em 0;
}

.markdown-body code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2em 0.5em;
    border-radius: 0.3em;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.markdown-body pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    margin: 1em 0;
    padding: 0.5em 1em;
    background: rgba(114, 47, 55, 0.1);
    color: var(--text-muted);
    border-radius: 0 0.5rem 0.5rem 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.markdown-body th,
.markdown-body td {
    padding: 0.75em 1em;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-body th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body a {
    color: var(--accent);
    text-decoration: underline;
}

.markdown-body a:hover {
    color: #fcd34d;
}

/* Contact links */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.contact-link:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--bg-surface-hover);
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
}

.contact-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1em 0;
}

.markdown-body hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2em 0;
}

/* Guide Footer */
.guide-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.github-link:hover {
    color: var(--accent);
}

.guides-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.github-repo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.github-repo-link:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

/* Responsive adjustments for guides */
@media (max-width: 600px) {
    .guides-header h1 {
        font-size: 2rem;
    }
    
    .contents-grid {
        grid-template-columns: 1fr;
    }
    
    .markdown-body {
        padding: 1.25rem 1rem;
    }
    
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}
