:root {
    --color-primary: #556B2F; /* Dark Olive Green */
    --color-secondary: #FF69B4; /* Pink */
    --color-bg-light: #F9FAFB;
    --color-bg-white: #FFFFFF;
    --color-text-dark: #333333;
    --color-text-light: #666666;
    --color-border: #E5E7EB;
    
    --border-radius: 0.5rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Font size base can be altered via JS to scale the whole app */
    font-size: 16px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    height: 100vh;
    overflow: hidden; /* Prevent body scroll, handled by layout wrapper */
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--color-bg-white);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-search {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--color-text-dark);
    transition: background-color 0.2s, color 0.2s;
}

.nav-menu li a:hover, .nav-menu li a.active {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
}

.nav-menu li a i {
    width: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

/* View Containers */
.view-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Topbar */
.mobile-topbar {
    display: none;
    height: 60px;
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
}

.mobile-topbar .icon-btn {
    background: none;
    border: none;
    color: var(--color-bg-white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: var(--box-shadow);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
}

.btn-primary:hover {
    background-color: #425522;
}

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

.text-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    text-align: left;
}

.icon-btn.hidden {
    display: none;
}

/* Small Icon Actions */
.icon-action-btn {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem; /* Larger for tablet */
    color: var(--color-text-light);
    transition: all 0.2s;
    padding: 0.5rem 0.75rem; /* Better touch target */
    margin-right: 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.icon-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.icon-action-btn.edit {
    color: var(--color-primary);
}

.icon-action-btn.edit:hover {
    background: var(--color-primary);
    color: var(--color-bg-white);
}

.icon-action-btn.delete {
    color: var(--color-secondary);
}

.icon-action-btn.delete:hover {
    background: var(--color-secondary);
    color: var(--color-bg-white);
}

/* Forms & Inputs */
input, textarea, select {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(85, 107, 47, 0.2);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.auth-form {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--color-bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Modern Lists */
.list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg-white);
    box-shadow: var(--box-shadow);
}

.list-modern li {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.list-modern li:last-child {
    border-bottom: none;
}

.list-modern li:hover {
    background-color: var(--color-bg-light);
}

.list-modern a {
    text-decoration: none;
    color: var(--color-text-dark);
    font-weight: 500;
}

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

/* Modern Tables */
.table-modern {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table-modern thead {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
}

.table-modern th, .table-modern td {
    padding: 1rem;
    text-align: left;
}

.table-modern tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

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

/* Tab Layout Adjustments */
.tab-content-padded {
    padding: 1.5rem !important;
}

#view-recipe-manager {
    display: none;
    flex-direction: column;
    height: 100%;
}

#view-recipe-manager.active {
    display: flex;
}

#view-recipe-manager .ui-tabs-nav {
    flex-shrink: 0;
}

#view-recipe-manager .ui-tabs-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0; /* Let inner padded containers handle it */
}

/* Responsive Rules */
@media (max-width: 768px) {
    /* Portrait Mode / Mobile */
    .mobile-topbar {
        display: flex;
    }
    
    .layout-wrapper {
        height: calc(100vh - 60px);
        position: relative;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: var(--box-shadow);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
    }
}
/* Importer Mapping Dialog Styles */
#import-mapping-dialog table tbody tr:nth-child(even) td {
    background-color: #f3f4f6; /* Light gray */
}
#import-mapping-dialog table tbody tr:nth-child(odd) td {
    background-color: #ffffff;
}
#import-mapping-dialog table tbody tr:hover td {
    background-color: #e5e7eb; /* Slightly darker on hover */
}

/* Markdown Content Styling */
.markdown-content ul, .markdown-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

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

.markdown-content p {
    margin-bottom: 1rem;
}
.markdown-content p:last-child {
    margin-bottom: 0;
}
