/* ===================================================
   CURIOUSPATHS - CUSTOM STYLES
   Varmt, naturligt färgschema (WCAG-anpassad)
   =================================================== */

/* ===================================================
   CSS VARIABLES - Dark Mode Support
   =================================================== */
:root {
    /* Primära färger */
    --primary-color: #d4915c;        /* Orange (HUVUDFÄRG) */
    --primary-hover: #e8a574;        /* Ljusare orange för hover */
    --primary-light: #D9B98A;        /* Ljus koppar (används i gradients) */
    
    --secondary-color: #6c9779;      /* Grön */
    --secondary-hover: #5a9370;      /* Mörkare grön */
    
    /* Bakgrundsfärger */
    --bg-primary: #faf8f5;           /* Ljus beige */
    --bg-secondary: #ffffff;         /* Vit */
    --bg-tertiary: #f5f1ec;          /* Ljus beige tertiary (för dark mode inputs) */
    --bg-gradient-start: #F7F4EE;    /* Gradient start (används i body) */
    --bg-gradient-end: #EDE6DD;      /* Gradient end (används i body) */
    
    /* Text */
    --text-primary: #2c2c2c;         /* Mörk text */
    --text-secondary: #6d5843;       /* Brun sekundär text */
    --text-muted: #999999;           /* Nedtonad text */
    
    /* Accent */
    --accent-warm: #e8a574;          /* Samma som primary-hover */
    --accent-brown: #6d5843;         /* Brun accent */
    
    /* Neutrala */
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Varma ljusa toner */
    --warm-light: #F7F4EE;
    --warm-lighter: #FCFBF9;
}

/* Apply theme */
.card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Dark mode specific adjustments */
[data-theme="dark"] .card {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-primary);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

[data-theme="dark"] footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%) !important;
}

/* Quill editor dark mode */
[data-theme="dark"] .ql-toolbar,
[data-theme="dark"] .ql-container {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ql-editor {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .ql-stroke {
    stroke: var(--text-primary);
}

[data-theme="dark"] .ql-fill {
    fill: var(--text-primary);
}

/* ===================================================
   GLOBAL STYLES
   =================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Subtil texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 145, 92, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 111, 71, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container, .navbar, footer {
    position: relative;
    z-index: 1;
}

/* Tydlig fokusmarkering för tangentbordsnavigering */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* ===================================================
   TYPOGRAPHY
   =================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.7; /* lite luftigare för läsbarhet */
}

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

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

/* ===================================================
   NAVBAR
   =================================================== */
.navbar {
    background: linear-gradient(135deg, #5A4636 0%, #2B241F 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #D9B98A !important;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #ffffff !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #D9B98A !important;
}

.nav-link.active {
    color: #D9B98A !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    filter: invert(1);
}

/* Dropdown i navbar (om du har) */
.navbar .dropdown-menu {
    background-color: #5A4636;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
}

.navbar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #D9B98A;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(184, 146, 90, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 12px rgba(184, 146, 90, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border: none;
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.125rem;
}

/* ===================================================
   CARDS
   =================================================== */
.card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(43, 36, 31, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* extra läsbarhet i längre textblock */
.card-body p + p {
    margin-top: 1rem;
}

.card-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* ===================================================
   FORMS
   =================================================== */
.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--white);
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(184, 146, 90, 0.25);
    outline: none;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(184, 146, 90, 0.25);
}

.input-group-text {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ===================================================
   BADGES
   =================================================== */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.badge.bg-success {
    background-color: #4A7C59 !important;
}

.badge.bg-warning {
    background-color: #D9B98A !important;
    color: var(--text-primary) !important;
}

/* ===================================================
   ALERTS
   =================================================== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: rgba(74, 124, 89, 0.1);
    color: #3E6648;
}

.alert-warning {
    background-color: rgba(217, 185, 138, 0.15);
    color: #8F5F3C;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #C82333;
}

.alert-info {
    background-color: rgba(139, 111, 71, 0.1);
    color: var(--secondary-color);
}

/* ===================================================
   PAGINATION
   =================================================== */
.pagination {
    margin: 2rem 0;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
    border-radius: 6px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===================================================
   TABLES
   =================================================== */
.table {
    background-color: var(--white);
}

.table thead th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-primary);
}

/* ===================================================
   FOOTER
   =================================================== */
footer {
    background: linear-gradient(135deg, #5A4636 0%, #2B241F 100%);
    box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
    color: white !important;
}

footer h5 {
    color: #D9B98A !important;
    font-weight: 600;
}

footer p,
footer li,
footer a {
    color: rgba(255, 255, 255, 0.9) !important;
}

footer a:hover {
    color: #D9B98A !important;
    text-decoration: none;
}

footer .bi {
    color: rgba(255, 255, 255, 0.9) !important;
}

footer .bi:hover {
    color: #D9B98A !important;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

footer .text-danger {
    color: #ff6b6b !important;
}

footer .d-flex.gap-3 a {
    transition: all 0.3s ease;
    opacity: 0.9;
}

footer .d-flex.gap-3 a:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* ===================================================
   SCROLL TO TOP BUTTON
   =================================================== */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(184, 146, 90, 0.4);
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scrollTopBtn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(184, 146, 90, 0.5);
}

/* ===================================================
   UTILITIES
   =================================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px var(--shadow) !important;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(43, 36, 31, 0.15) !important;
}

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInFromLeft 0.6s ease-out;
}

/* Reducerad rörelse för de som valt det i systemet */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================================
   ADMIN - Delete button wrapper
   =================================================== */
.delete-wrapper {
    display: inline-block;
}

.delete-wrapper .btn-delete:disabled {
    opacity: 0.5;
}

/* ===================================================
   MEDIA PICKER
   =================================================== */
.media-picker-item:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===================================================
   HERO SECTION
   =================================================== */
.hero-section {
    background-color: #faf8f5;
    border-left: 6px solid var(--primary-color);
    border: 1px solid #e8e5df;
}

.hero-section h1 {
    color: var(--primary-color);
}

.hero-section .lead {
    color: #495057;
    font-size: 1.15rem;
    line-height: 1.7;
}

.hero-section img {
    filter: drop-shadow(0 4px 12px rgba(212, 145, 92, 0.3));
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    #scrollTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }

    .hero-section {
        padding: 3rem 1.5rem !important;
    }
}

@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   TAB NAVIGATION - Stark kontrast
   ======================================== */

.nav-tabs {
    border-bottom: 2px solid #dee2e6 !important;
    margin-bottom: 0 !important;
}

.nav-tabs .nav-link {
    color: #212529 !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    background-color: #f8f9fa !important;
    margin-right: 4px !important;
    padding: 0.75rem 1.25rem !important;
}

.nav-tabs .nav-link:hover {
    color: #ffffff !important;
    background-color: #e8a574 !important;
    border-color: #e8a574 !important;
}

.nav-tabs .nav-link.active {
    color: #ffffff !important;
    font-weight: 600 !important;
    background-color: #d4915c !important;
    border-color: #d4915c !important;
    border-bottom-color: #ffffff !important;
}

.nav-tabs .nav-link i {
    margin-right: 6px !important;
}

.tab-content {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-top: none !important;
}

/* ========================================
   BLOG POST CONTENT - Bättre läsbarhet
   ======================================== */

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.post-content h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--accent-warm);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.post-content code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* ========================================
   PROFILE IMAGE
   ======================================== */

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 145, 92, 0.4);
}

/* Responsiv storlek */
@media (max-width: 768px) {
    .profile-image {
        width: 120px;
        height: 120px;
    }
}