:root {
    --primary-color: #ff6b35; /* Happy Fox Orange */
    --secondary-color: #2c3e50; /* Mörk blå-grå */
    --success-color: #27ae60; /* Grön för framsteg */
    --warning-color: #f39c12; /* Orange för varningar */
    --error-color: #e74c3c; /* Röd för fel */
    --accent-color: #3498db; /* Ljusblå för accenter */
    --background-light: #ffffff;
    --background-dark: #121212;
    --text-light: #121212;
    --text-dark: #ffffff;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: var(--background-light);
    margin: 0;
    padding: 0;
}

@media (prefers-color-scheme: dark) {
    body {
        background: var(--background-dark);
        color: var(--text-dark);
    }
}

/* App Container (Mobile First) */
.hfsl-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigering (Fällbar som standard) */
.hfsl-nav {
    background: var(--secondary-color);
    color: var(--text-dark);
    padding: 10px;
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 250px;
    transition: transform 0.3s ease;
    z-index: 1001;
}

@media (prefers-color-scheme: dark) {
    .hfsl-nav {
        background: darken(var(--secondary-color), 10%);
    }
}

.hfsl-nav.active {
    transform: translateX(0);
}

.hfsl-nav-header {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hfsl-logo {
    width: 60px;
    height: auto;
}

.hfsl-nav-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 5px;
}

.hfsl-nav-menu {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.hfsl-nav-menu li {
    margin: 0;
}

.hfsl-nav-menu a {
    display: flex;
    align-items: center;
    padding: 10px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.hfsl-nav-menu a:hover,
.hfsl-nav-menu a.active {
    background: rgba(255, 255, 255, 0.1);
}

.hfsl-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
}

.hfsl-icon.dashboard { background-image: url('data:image/svg+xml;utf8,<svg>...</svg>'); }
.hfsl-icon.workout { background-image: url('data:image/svg+xml;utf8,<svg>...</svg>'); }
.hfsl-icon.nutrition { background-image: url('data:image/svg+xml;utf8,<svg>...</svg>'); }
.hfsl-icon.analytics { background-image: url('data:image/svg+xml;utf8,<svg>...</svg>'); }
.hfsl-icon.settings { background-image: url('data:image/svg+xml;utf8,<svg>...</svg>'); }

.hfsl-nav-toggle {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    width: 25px;
    height: 20px;
    cursor: pointer;
    z-index: 1002;
}

.hfsl-nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    margin: 4px 0;
    transition: all 0.3s;
}

.hfsl-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hfsl-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.hfsl-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Huvudinnehåll (Mobile First) */
.hfsl-main {
    padding: 10px;
    flex-grow: 1;
    width: 100%;
}

@media (min-width: 769px) {
    .hfsl-app {
        flex-direction: row;
    }

    .hfsl-nav {
        transform: translateX(0);
        position: static;
        width: 250px;
    }

    .hfsl-nav-toggle {
        display: none;
    }

    .hfsl-main {
        margin-left: 250px;
        padding: 20px;
    }
}

/* Dashboard Styling (Mobile First) */
.hfsl-dashboard {
    margin: 0;
    padding: 0 0 10px;
}

.hfsl-widgets {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.hfsl-widget {
    background: var(--background-light);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    .hfsl-widget {
        background: #1e1e1e;
        border-color: #333;
    }
}

@media (min-width: 769px) {
    .hfsl-widgets {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .hfsl-widget {
        padding: 20px;
        border-radius: 8px;
    }
}

/* Snabbåtgärder och badges (Mobile First) */
.hfsl-quick-actions {
    margin-bottom: 20px;
}

.hfsl-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 5px 0;
    width: 100%;
    transition: background 0.3s;
}

.hfsl-button:hover {
    background: darken(var(--primary-color), 10%);
}

.hfsl-button:focus {
    outline: 2px solid var(--accent-color);
}

@media (min-width: 769px) {
    .hfsl-button {
        display: inline-block;
        width: auto;
        margin-right: 10px;
    }
}

.hfsl-badges-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 769px) {
    .hfsl-badges-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
}

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

.hfsl-modal-content {
    background: var(--background-light);
    padding: 15px;
    border-radius: 6px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

@media (prefers-color-scheme: dark) {
    .hfsl-modal-content {
        background: #1e1e1e;
    }
}

.hfsl-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Lazy loading och tillgänglighet behålls från tidigare */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

button, .hfsl-button {
    outline: none;
}

button:focus, .hfsl-button:focus {
    outline: 2px solid var(--accent-color);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}