:root {
    --primary-color: #ff6b6b;
    --primary-hover: #fa5252;
    --secondary-color: #4ecdc4;
    --background-color: #f7f9fc;
    --surface-color: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border-radius: 16px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    --nav-height: 70px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    /* Prevent overall body scroll, we scroll the carousel instead */
    overflow: hidden; 
}

/* Layout - Carousel Container */
.carousel-viewport {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    padding-bottom: var(--nav-height);
    box-sizing: border-box;
}

.carousel-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth; /* Smooth for click navigation */
    /* Hide scrollbar */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-page {
    min-width: 100vw; /* Take full width */
    height: 100%;
    scroll-snap-align: start;
    overflow-y: auto; /* Allow vertical scroll inside each page */
    padding: 24px;
    box-sizing: border-box;
}

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

.page-title {
    font-size: 1.75rem;
    margin-bottom: 24px;
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    margin-bottom: 16px;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-icon {
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.btn-floating {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    z-index: 100;
}

/* Inputs */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.custom-checkbox.checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.strikethrough {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--surface-color);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-indicator {
    position: absolute;
    top: -28px;
    left: 0;
    width: 20%; /* 100% / 5 columns */
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    
    /* Dynamic position driven by JS scroll tracking */
    transform: translateX(calc(var(--scroll-ratio, 2) * 100%)); 
    /* No transition here! We want instant follow of the finger. 
       The smooth movement comes from the scroll behavior itself. */
}

.nav-indicator-circle {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    height: 100%;
    transition: color 0.2s;
    z-index: 2;
    cursor: pointer;
}

.nav-item.active {
    color: white;
}

/* Animation for the icon when active to give it a pop effect */
.nav-item.active .material-icons {
    transform: translateY(-32px);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.nav-item .material-icons {
    font-size: 28px;
    display: block;
    position: relative;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 16px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.tab-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
