/* ===================================
   Git & GitHub Guide - Stilmall
   Skapat: 2026-01-17
   =================================== */

/* Grundläggande reset och variabler */
:root {
    --primary-color: #2ea44f;
    --secondary-color: #0969da;
    --background: #ffffff;
    --surface: #f6f8fa;
    --border: #d0d7de;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --code-bg: #f6f8fa;
    --warning: #fb8500;
    --success: #2ea44f;
    --error: #cf222e;
    --input-bg: #fffacd; /* Gul bakgrund för input-fält enligt regel 18 */
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header och navigation */
header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 20px;
}

.top-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.top-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: background 0.3s;
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Kort (Cards) */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Info-boxar */
.info-box {
    background: #ddf4ff;
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
}

.info-box.success {
    background: #dafbe1;
    border-left-color: var(--success);
}

.info-box.warning {
    background: #fff8c5;
    border-left-color: var(--warning);
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
}

/* Struktur-diagram */
.structure-diagram {
    background: white;
    border: 2px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

/* Steg */
.step {
    margin: 30px 0;
    padding-left: 20px;
    border-left: 3px solid var(--primary-color);
}

.step h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.step ol, .step ul {
    margin-left: 20px;
    margin-top: 10px;
}

.step li {
    margin: 8px 0;
}

/* Kodblock */
.code-block {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-block pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre;
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #2c974b;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Input-fält - REGEL 18: Gul bakgrund för indata */
.input-field {
    background: var(--input-bg) !important; /* Gul bakgrund */
    border: 2px solid var(--warning);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

input.input-field[type="number"],
input.input-field[type="text"] {
    width: 100px;
    margin: 0 10px;
}

/* Knappar */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #2c974b;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-small {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #0860ca;
}

/* Interaktiv demo */
.interactive-demo {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    margin: 20px 0;
}

.interactive-demo h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Arbetsflöde */
.workflow {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.workflow-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.workflow-step:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
}

.step-number {
    min-width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Kommando-grid */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.command-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s;
}

.command-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.command-card h4 {
    color: var(--secondary-color);
    font-family: 'Consolas', 'Monaco', monospace;
    margin-bottom: 10px;
}

/* Visualisering */
.visualization {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin: 30px 0;
    align-items: center;
}

.viz-box {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.viz-local h4, .viz-remote h4 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.viz-arrows {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* FAQ / Accordion */
.faq {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 15px 0;
    overflow: hidden;
}

.faq summary {
    padding: 15px;
    cursor: pointer;
    background: var(--surface);
    font-weight: bold;
    color: var(--secondary-color);
    user-select: none;
    transition: background 0.3s;
}

.faq summary:hover {
    background: #e8ecef;
}

.faq-content {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--error);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    border-top: 2px solid var(--border);
    color: var(--text-secondary);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsiv design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .visualization {
        grid-template-columns: 1fr;
    }
    
    .viz-arrows {
        transform: rotate(90deg);
    }
    
    .commands-grid {
        grid-template-columns: 1fr;
    }
    
    .workflow-step {
        flex-direction: column;
    }
}
