/* IgAN Health Manager - Custom Styles */

:root {
    --primary-color: #3389fd;
    --secondary-color: #00b894;
    --tertiary-color: #f66f66;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --success-color: #00b894;

    --shiny-cta-bg: #000000;
    --shiny-cta-bg-subtle: var(--primary-color);
    --shiny-cta-fg: #ffffff;
    --shiny-cta-highlight: blue;
    --shiny-cta-highlight-subtle: #8484ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
  }
  
  @property --gradient-angle-offset {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
  }
  
  @property --gradient-percent {
    syntax: "<percentage>";
    initial-value: 5%;
    inherits: false;
  }
  
  @property --gradient-shine {
    syntax: "<color>";
    initial-value: white;
    inherits: false;
  }
  
  .shiny-cta {
    --animation: gradient-angle linear infinite;
    --duration: 3s;
    --shadow-size: 2px;
    isolation: isolate;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    outline-offset: 4px;
    padding: 25px 60px !important;
    font-family: inherit;
    transition: all 0.3s ease !important;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 360px;
    color: var(--shiny-cta-fg);
    background: linear-gradient(var(--shiny-cta-bg), var(--shiny-cta-bg))
        padding-box,
      conic-gradient(
          from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
          transparent,
          var(--shiny-cta-highlight) var(--gradient-percent),
          var(--gradient-shine) calc(var(--gradient-percent) * 2),
          var(--shiny-cta-highlight) calc(var(--gradient-percent) * 3),
          transparent calc(var(--gradient-percent) * 4)
        )
        border-box;
    box-shadow: inset 0 0 0 1px var(--shiny-cta-bg-subtle);
  
    &::before,
    &::after,
    span::before {
      content: "";
      pointer-events: none;
      position: absolute;
      inset-inline-start: 50%;
      inset-block-start: 50%;
      translate: -50% -50%;
      z-index: -1;
    }
  
    &:active {
      translate: 0 1px;
    }
  }
  
  /* Dots pattern */
  .shiny-cta::before {
    --size: calc(100% - var(--shadow-size) * 3);
    --position: 2px;
    --space: calc(var(--position) * 2);
    width: var(--size);
    height: var(--size);
    background: radial-gradient(
        circle at var(--position) var(--position),
        white calc(var(--position) / 4),
        transparent 0
      )
      padding-box;
    background-size: var(--space) var(--space);
    background-repeat: space;
    mask-image: conic-gradient(
      from calc(var(--gradient-angle) + 45deg),
      var(--primary-color),
      transparent 10% 90%,
      var(--secondary-color)
    );
    border-radius: inherit;
    opacity: 0.4;
    z-index: -1;
  }
  
  /* Inner shimmer */
  .shiny-cta::after {
    --animation: shimmer linear infinite;
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(
      -50deg,
      transparent,
      var(--primary-color),
      transparent
    );
    mask-image: radial-gradient(circle at bottom, transparent 40%, var(--primary-color));
    opacity: 0.6;
  }
  
  .shiny-cta span {
    z-index: 1;
  
    &::before {
      --size: calc(100% + 1rem);
      width: var(--size);
      height: var(--size);
      box-shadow: inset 0 -1ex 2rem 4px var(--shiny-cta-highlight);
      opacity: 0;
    }
  }
  
  /* Animate */
  .shiny-cta {
    --transition: 800ms cubic-bezier(0.25, 1, 0.5, 1);
    transition: var(--transition);
    transition-property: --gradient-angle-offset, --gradient-percent,
      --gradient-shine;
  
    &,
    &::before,
    &::after {
      animation: var(--animation) var(--duration),
        var(--animation) calc(var(--duration) / 0.4) reverse paused;
      animation-composition: add;
    }
  
    span::before {
      transition: opacity var(--transition);
      animation: calc(var(--duration) * 1.5) breathe linear infinite;
    }
  }
  
  .shiny-cta:is(:hover, :focus-visible) {
    --gradient-percent: 20%;
    --gradient-angle-offset: 95deg;
    --gradient-shine: var(--shiny-cta-highlight-subtle);
    transform: unset !important;
    transition: all 0.3s ease !important;
  
    &,
    &::before,
    &::after {
      animation-play-state: running;
    }
  
    span::before {
      opacity: 1;
    }
  }
  
  @keyframes gradient-angle {
    to {
      --gradient-angle: 360deg;
    }
  }
  
  @keyframes shimmer {
    to {
      rotate: 360deg;
    }
  }
  
  @keyframes breathe {
    from,
    to {
      scale: 1;
    }
    50% {
      scale: 1.2;
    }
  }

.main-container {
    margin-bottom: 60px;
    margin-top: 40px !important;
}

.footer {
    padding: 40px 0;
    margin-top: 60px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 100%;
}
.footer-heading {
    color: white;
}

.footer-logo {
    background: white;
    border-radius: 12px;
}

.footer-social {
    display: flex;
    margin-top: 20px;
    gap: 20px;
}

.footer li a {
    color: white;
}

.footer-heading {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-copyright {
    margin-top: 20px;
}

.footer-copyright a {
    color: white;
    text-decoration: underline;
}

.uk-navbar {
    background: var(--primary-color) !important;
}
.uk-navbar-container {
    margin: auto;
    width: 95%;

}

.uk-navbar-item {
    font-weight: 700;
}

.uk-navbar-item, .uk-navbar-nav > li > a {
    color: white !important;
}

.uk-navbar-nav > li > a:hover {
    color: #ddd !important;
}

/* Cards */
.health-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.health-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* AI Insights - Scan Documents tab: coming soon state */
.scan-docs-coming-soon {
    position: relative;
}

.scan-docs-card-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.scan-docs-card-disabled:hover {
    transform: none;
}

.coming-soon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    pointer-events: auto;
}

.coming-soon-badge {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
}

/* Stats */
.stat-box {
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    text-align: center;
}

.stat-box h3 {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
}

.stat-box p {
    margin: 5px 0 0;
    opacity: 0.9;
}

.uk-accordion {
    li {
        border-bottom: 1px solid var(--primary-color);
        padding-bottom: 20px;
    }

    .uk-accordion-title {
        font-weight: 700;
    }
}

/* BP Status Indicators */
.bp-normal {
    color: var(--success-color);
}

.bp-elevated {
    color: var(--warning-color);
}

.bp-high {
    color: var(--danger-color);
}

/* Form Enhancements */
.tracker-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tom Select (activity dropdown) in fitness form */
#fitnessForm .ts-wrapper {
    padding: 0;
    border-radius: 0;
}
#fitnessForm .ts-wrapper .ts-control {
    padding: 10px;
    border-radius: 0;
    height: 100%;
}
#fitnessForm .ts-wrapper .ts-dropdown {
    border-radius: 0;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 30px;
}

/* Medication Checklist */
.medication-item {
    padding: 15px;
    background: white;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.medication-item.taken,
.medication-item.medication-taken {
    opacity: 0.7;
    border-left-color: var(--success-color);
    background: #e8f5e9;
}

.medication-item.medication-taken label {
    color: #666;
}

.medication-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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



/* Stat Card with Icon */
.stat-card-flex {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px !important;
}

.stat-icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    padding: 10px;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.stat-data{text-align: center;} 
.stat-card-flex .stat-box {
    flex: 1;
    text-align: left;
    margin: 0;
    display: flex;
    justify-content: space-between;
}

.stat-card-flex .stat-box h3 {
    margin: 0 0 5px 0;
    font-size: 2em;
    font-weight: bold;
}

.stat-card-flex .stat-box p {
    margin: 0;
    font-size: 0.9em;
    font-weight: 500;
}

/* Multi-select dropdown styling */
#ckdTypes {
    padding: 10px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    min-height: 300px;
    cursor: pointer;
}

#ckdTypes:focus {
    border-color: var(--primary-color);
    outline: none;
}

#ckdTypes option {
    padding: 10px 15px;
    margin: 3px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#ckdTypes option:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

#ckdTypes option:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    font-weight: 600;
}

/* For WebKit browsers (Chrome, Safari) */
#ckdTypes option:checked::before {
    content: "✓ ";
}

#ckdTypes optgroup {
    font-weight: 700;
    font-style: normal;
    color: var(--primary-color);
    margin-top: 10px;
    padding-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ckdTypes optgroup:first-child {
    margin-top: 0;
}

/* Info helper for multi-select */
.multi-select-helper {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #333;
}

.multi-select-helper strong {
    color: var(--primary-color);
}

.multi-select-helper kbd {
    background: #e5e5e5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ccc;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.selected-tags .uk-label {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Daily Tip Card */
.daily-tip {
    background: var(--secondary-color);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.daily-tip-animation {
    width: 100%;
}

.daily-tip-animation dotlottie-wc {
    width: 100%;
    height: auto;
}

.daily-tip-animation dotlottie-wc::part(canvas) {
    border-radius: 12px;
}

.daily-tip svg, .daily-tip.motivation svg {
    margin-left: 15px;
}

.quick-stats .uk-card {
    padding: 15px;
} 

.daily-tip.motivation {
    background: var(--tertiary-color);
}

.daily-tip h3, .daily-tip.motivation h3 {
    color: white;
    margin-top: 0;
    font-weight: 700;
    font-size: 20px;
}

/* Diet Plan */
.meal-card {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--secondary-color);
}

.meal-card h4,
.meal-card h5 {
    margin: 0 0 10px;
    color: var(--primary-color);
}

.meal-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meal-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.meal-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0 !important;
}

.meal-detail-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.meal-nutrients {
    font-size: 0.9em;
    color: #666;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .stat-box h3 {
        font-size: 2em;
    }
    
    /* Dashboard element reordering handled by new responsive breakpoints above */
    
    /* All h2 elements centered on mobile */
    h2 {
        text-align: center !important;
    }
    
    /* Tablist border-bottom for better click indication */
    [role="tablist"],
    .uk-tab {
        border-bottom: 2px solid #e5e5e5;
    }
    
    [role="tab"],
    .uk-tab > li > a {
        border-bottom: 3px solid transparent;
        transition: border-bottom-color 0.2s ease;
    }
    
    [role="tab"][aria-selected="true"],
    .uk-tab > li.uk-active > a {
        border-bottom-color: var(--primary-color);
    }
    
    /* Button line-height fix - make it equal to font-size (not chubby) */
    .uk-button {
        line-height: 1em !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .uk-button-small {
        line-height: 1em !important;
    }
    
    .uk-button-large {
        line-height: 1em !important;
    }
    
    /* Flex elements with uk-flex-between should be in row on mobile */
    .uk-flex.uk-flex-between.uk-flex-middle.uk-margin-bottom {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .uk-flex.uk-flex-between.uk-flex-middle.uk-margin-bottom > * {
        flex: 0 1 auto;
    }
    
    /* Form improvements */
    .uk-form-stacked .uk-margin {
        margin-bottom: 20px;
    }
    
    /* Grid adjustments */
    .uk-grid-small.uk-child-width-1-2\@s > *,
    .uk-grid-small.uk-child-width-1-3\@s > *,
    .uk-grid-small.uk-child-width-1-4\@s > * {
        width: 100% !important;
    }
    
    /* Button groups stack on mobile */
    .uk-button-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .uk-button-group .uk-button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Card improvements */
    .uk-card {
        margin-bottom: 20px;
    }
    
    /* Health cards */
    .health-card {
        padding: 15px;
    }
    
    /* Stat cards */
    .stat-card-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin: 0 auto 10px;
    }
    
    /* Meal cards in diet plans */
    .uk-grid-small.uk-child-width-1-4\@m > * {
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    /* Tab improvements */
    .uk-tab {
        flex-wrap: wrap;
    }
    
    .uk-tab > li {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .uk-tab > li > a {
        font-size: 14px;
        padding: 10px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Welcome Page */
.uk-section-muted {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 80vh;
    padding-top: 50px;
}

.red-icon {
    svg {
        color: var(--danger-color) !important;
    }
}

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

.welcome-page {
    padding-bottom: 60px !important;


    @media (max-width: 768px) {
        .cards-wrap {
            margin-left: -12px !important;
        }
    }

    .logo-wrap {
        img {
            width: 450px;
            height: auto;
            background-color: white;
            border-radius: 12px;
            padding: 0 30px;
        }
    }

    .cards-wrap {
        margin-top: 40px !important;
    }

    .text-lead-welcome {
        margin-top: 40px;
    }

    .get-started-card {
        padding: 25px !important;
        border-radius: 24px;
        box-shadow: 10px 10px 55px rgba(0, 0, 0, 0.5);

        h3 {
            margin-top: 10px;;
        }
    }

    .get-started-wrap {
        margin-top: 40px !important;
    }
}

.uk-section-muted h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.uk-section-muted .uk-text-lead {
    color: rgba(255, 255, 255, 0.95);
}

.uk-section-muted .uk-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.uk-section-muted .uk-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.uk-button-large {
    padding: 15px 50px;
    font-size: 1.1em;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.uk-button-large:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Utility Classes */
.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

/* AI Medical Chatbot */
.chat-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 9999;
}

.chat-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    color: white;
    margin: 0;
}

.chat-header p {
    color: rgba(255, 255, 255, 0.9);
}

.chat-header button {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s;
}

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

.user-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: white;
    color: #333;
    border: 1px solid #e5e7eb;
    margin-right: auto;
}

.bot-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.bot-message p {
    margin: 8px 0;
}

.typing {
    opacity: 0.7;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input form {
    gap: 10px;
}

.chat-input input {
    flex: 1;
}

.chat-input button {
    width: 50px;
}

/* ========================================
   SIDEBAR LAYOUT - Modern App Style
   ======================================== */

/* App Layout Container */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Vertical Sidebar */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Sidebar Header */
.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    background: white;
    border-radius: 12px;
}


.sidebar-logo svg {
    width: 48px;
    height: 48px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav li {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #ffd700;
    color: white;
    padding-left: 24px;
}

.sidebar-nav li.active a {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: #ffd700;
    font-weight: 700;
    color: white;
}

.sidebar-nav li a span[uk-icon] {
    margin-right: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: rgba(255,255,255,0.7);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 30px;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Guest layout: no sidebar, full-width main */
body[data-guest="true"] #sidebar,
body[data-guest="true"] .mobile-sidebar-toggle {
    display: none !important;
}
body[data-guest="true"] .main-content {
    margin-left: 0;
    max-width: none;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: var(--primary-color) !important;
    color: white;
    border: none;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(51, 137, 253, 0.4);
    transition: all 0.3s ease;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(51, 137, 253, 0.6);
    background: var(--primary-color) !important;
}

/* Hamburger Icon Container */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 18px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hamburger Lines */
.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    top: 0;
}

.hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
    bottom: 0;
}

/* X Icon State (when sidebar is active) */
.sidebar.active ~ .app-layout .mobile-sidebar-toggle .hamburger-line:nth-child(1),
.app-layout:has(.sidebar.active) .mobile-sidebar-toggle .hamburger-line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.sidebar.active ~ .app-layout .mobile-sidebar-toggle .hamburger-line:nth-child(2),
.app-layout:has(.sidebar.active) .mobile-sidebar-toggle .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scale(0);
}

.sidebar.active ~ .app-layout .mobile-sidebar-toggle .hamburger-line:nth-child(3),
.app-layout:has(.sidebar.active) .mobile-sidebar-toggle .hamburger-line:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Alternative selector for when sidebar has active class */
.mobile-sidebar-toggle.active .hamburger-line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-sidebar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scale(0);
}

.mobile-sidebar-toggle.active .hamburger-line:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Mobile Responsive - Sidebar */
@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%) !important;
        width: 280px; /* Slightly wider on mobile for better usability */
    }
    
    .sidebar.active {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 20px 15px;
        padding-top: 10px; /* Space for mobile toggle */
        width: 100%;
    }
    
    .mobile-sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--primary-color) !important;
    }
    
    /* Ensure app-layout doesn't cause overflow */
    .app-layout {
        overflow-x: hidden;
    }
}

/* Overlay when sidebar is open on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Remove old styles that conflict with sidebar */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Global text wrapping - Prevent overflow on all resolutions */
h1, h2, h3, h4, h5, h6, p, .uk-card-title, .uk-text-large, .uk-text-lead {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Ensure no element forces horizontal scroll */
* {
    max-width: 100%;
    box-sizing: border-box;
}

img, svg, canvas {
    max-width: 100%;
    height: auto;
}

/* Mini Chart Container - Desktop */
.mini-chart-container {
    height: 300px;
    width: 100%;
}

.daily-tip-animation {
    height: auto;
}

.daily-tip-animation dotlottie-wc {
    max-width: 200px !important;
    height: 190px !important;
}

/* Dashboard top section - semantic layout */
.dashboard-top-section {
    margin-bottom: 1rem;
}

/* Row 1: Health Score + Tips - side by side on desktop, stacked on mobile */
.dashboard-row-1 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-row-1 .daily-health-score-wrap {
    flex: 1 1 300px;
    min-width: 0;
}

.dashboard-row-1 .daily-tips-wrap {
    flex: 1 1 300px;
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Row 2: Quick Stats - always full width, own row */
.dashboard-row-2 {
    width: 100%;
    margin-bottom: 1rem;
}

.quick-stats-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px;
    justify-content: flex-start;
}

/* Desktop: 6 stat cards - 3 per row, aligned grid */
.quick-stats-container > .uk-card.stat-card-flex {
    flex: 0 1 calc((100% - 20px) / 3);
    min-width: 160px;
}

.tips-wrap {
    margin-bottom: 0;

    .first {
        margin-bottom: 10px;
    }

    .second {
        margin-bottom: 0 !important;
    }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet: 2 per row */
@media (max-width: 900px) {
    .quick-stats-container > .uk-card.stat-card-flex {
        flex: 0 1 calc((100% - 10px) / 2);
        min-width: 140px;
    }
}

/* Mobile (max 640px): 2 per row */
@media (max-width: 640px) {
    .dashboard-row-1 {
        flex-direction: column;
    }
    
    .dashboard-row-1 .daily-health-score-wrap,
    .dashboard-row-1 .daily-tips-wrap {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .quick-stats-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .quick-stats-container > .uk-card.stat-card-flex {
        flex: 0 1 calc((100% - 10px) / 2);
        min-width: min(100%, 140px);
    }
    
    .stat-card-flex {
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .stat-icon {
        margin: 0 !important;
    }
}

/* Narrow mobile (max 400px): 1 per row - full width */
@media (max-width: 400px) {
    .quick-stats-container > .uk-card.stat-card-flex {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* Medium Screens (768px - 1200px) - Tablet & Small Laptop */
@media (min-width: 768px) and (max-width: 1200px) {
    /* Reduce sidebar width slightly for more content space */
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 25px;
    }
    
    .sidebar-logo {
        font-size: 18px;
    }
    
    .sidebar-logo svg {
        width: 40px;
        height: 40px;
    }
    
    .sidebar-nav li a {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    /* Dashboard Grid Adjustments */
    .uk-width-1-2\@m {
        width: 100% !important;
    }
    
    .uk-width-1-3\@m {
        width: 50% !important;
    }
    
    /* Charts - Make full width for better visibility */
    .chart-container {
        height: 350px !important;
    }
    
    /* Mini charts - Slightly taller */
    .mini-chart-container {
        height: 320px !important;
    }
    
    /* Stat cards - Full width for clarity */
    .stat-card-flex {
        flex-direction: row;
        text-align: left;
    }
    
    .stat-icon {
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    /* Button groups - Stack on medium screens */
    .uk-button-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .uk-button-group .uk-button {
        flex: 1 1 auto;
        min-width: 70px;
    }
    
    /* Health cards - Better spacing */
    .health-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .health-card h3 {
        font-size: 18px;
        word-break: break-word;
    }
    
    /* Footer - Stack to 2 columns */
    .footer .uk-child-width-1-4\@m > div {
        width: 50% !important;
    }
    
    .footer {
        padding: 30px 20px;
    }
    
    /* Card grid spacing */
    .uk-grid-large {
        margin-left: -15px;
    }
    
    .uk-grid-large > * {
        padding-left: 15px;
    }
    
    /* Main content padding adjustment */
    .main-content {
        padding: 20px;
    }
    
    /* Form improvements */
    .uk-grid-small.uk-child-width-1-2\@s > * {
        width: 50% !important;
    }
    
    .uk-grid-small.uk-child-width-1-3\@s > * {
        width: 33.333% !important;
    }
}

/* Mobile Responsive Tables - Make scrollable on ≤768px */
@media (max-width: 768px) {
    /* Wrap tables in scrollable container */
    .uk-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .uk-table thead,
    .uk-table tbody,
    .uk-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .uk-table td,
    .uk-table th {
        font-size: 12px;
        padding: 8px 4px;
        word-break: break-word;
        white-space: normal;
    }
    
    /* Stack table info on very small screens */
    .uk-table td small {
        font-size: 10px;
        display: block;
    }
    
    /* Make health cards full width on mobile */
    .health-card {
        margin: 10px 0;
    }
    
    /* Increase mini chart heights on mobile for better visibility */
    .mini-chart-container {
        height: 350px !important;
    }
    
    /* Reduce main dashboard chart heights on mobile */
    .chart-container {
        height: 250px !important;
    }
    
    /* Stack footer columns on mobile */
    .footer {
        padding: 30px 15px;
        margin-top: 40px;
    }
    
    .footer .uk-grid-large {
        margin-left: -10px;
    }
    
    .footer .uk-grid-large > * {
        padding-left: 10px;
    }
    
    .footer .uk-child-width-1-4\@m > div {
        width: 100% !important;
        margin-bottom: 30px;
    }
    
    .footer-heading {
        font-size: 18px;
    }
    
    .footer-text, .footer-copyright {
        font-size: 13px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-upgrade-btn {
        width: 100%;
        padding: 15px !important;
        font-size: 12px !important;
        white-space: normal;
        word-wrap: break-word;
    }

    
    /* Footer bottom section */
    .footer-bottom {
        padding: 20px 0;
    }
    
    .footer-bottom .uk-grid-small {
        margin-left: 0;
    }
    
    .footer-bottom .uk-grid-small > * {
        padding-left: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
    }
    
    .chat-float-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    /* Extra small adjustments */
    .uk-table td,
    .uk-table th {
        font-size: 11px;
        padding: 6px 3px;
    }
    
    .uk-button {
        font-size: 12px;
        padding: 0 15px;
    }
    
    /* Multi-select helper text on mobile */
    .multi-select-helper {
        font-size: 12px;
        line-height: 1.6;
    }
    
    .multi-select-helper kbd {
        font-size: 11px;
        padding: 2px 4px;
    }

    .bpMiniChartCont {
        height: 400px;
    }
    
    /* Login/Register form adjustments */
    .uk-card.uk-width-large {
        width: 100% !important;
        margin: 0 10px;
    }

    .login-form-wrap {
        .login-text-lead {
            margin-top: 0;
            margin-bottom: 40px;
        }
    }
    
    /* Footer text wrapping */
    .footer-copyright {
        font-size: 11px;
        line-height: 1.6;
        word-break: break-word;
    }
    
    /* Welcome page cards */
    .uk-grid-match.uk-child-width-1-3\@m {
        display: block;
    }
    
    .uk-grid-match.uk-child-width-1-3\@m > * {
        width: 100% !important;
        margin-bottom: 20px;
    }
    
    /* Section padding adjustments */
    .uk-section {
        padding: 40px 15px;
    }
    
    .uk-section-muted {
        padding-top: 40px;
        min-height: auto;
    }
    
    /* Heading sizes */
    .uk-heading-medium {
        font-size: 28px;
    }
    
    .uk-text-lead {
        font-size: 16px;
    }
}

/* Very small screens (320px - 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px;
        padding-top: 10px;
    }
    
    .mobile-sidebar-toggle {
        width: 45px;
        height: 45px;
        top: 15px;
        left: 15px;
    }
    
    .uk-heading-medium {
        font-size: 24px;
    }
    
    .uk-text-lead {
        font-size: 14px;
    }
    
    .stat-box h3 {
        font-size: 1.8em;
    }

    .stat-box {
        flex: 1;
        text-align: center;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }
    
    .health-card {
        padding: 12px;
    }
    
    .uk-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .uk-button-large {
        padding: 12px 30px;
        font-size: 16px;
    }

    .daily-tip-animation dotlottie-wc {
        max-width: 220px;
    }
}

/* Large screens (1200px - 1440px) */
@media (min-width: 1200px) and (max-width: 1440px) {
    .main-content {
        padding: 40px;
    }
    
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
}


/* Extra large screens (1440px+) */
@media (min-width: 1440px) {
    .main-content {
        padding: 50px;
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .uk-container {
        max-width: 1400px;
    }
}

/* Mobile Navigation Responsive Styles */
/* Hide hamburger on desktop (>760px) */
@media (min-width: 761px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Show hamburger and hide desktop nav on mobile (≤760px) */
@media (max-width: 760px) {
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        color: white;
        transition: all .3ms;
    }
    
    /* Make logo smaller on mobile */
    .uk-logo svg {
        width: 36px !important;
        height: 36px !important;
    }
    
    .uk-logo {
        font-size: 16px !important;
    }
}

/* Mobile Off-Canvas Menu Styling */
.uk-offcanvas-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.uk-offcanvas-bar h3 {
    color: white;
    font-weight: 700;
}

.uk-offcanvas-bar .uk-nav-primary > li > a {
    color: white !important;
    font-size: 18px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.uk-offcanvas-bar .uk-nav-primary > li > a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(5px);
}

.uk-offcanvas-bar .uk-nav-primary > li.uk-active > a {
    background: rgba(255, 255, 255, 0.3) !important;
    font-weight: 700;
}

.uk-offcanvas-close {
    color: white !important;
}

.uk-offcanvas-close:hover {
    color: #ffd700 !important;
}




/* Cat Mood Section - Mobile Responsive */
.cat-mood-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cat-score-top {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

.cat-score-top h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.score-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.score-subtitle {
    display: block;
    margin-top: 8px;
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

.cat-animation-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.cat-tips-bottom {
    width: 100%;
    margin-top: 20px;
}

.tips-reason,
.tips-improve {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.tips-reason strong,
.tips-improve strong {
    display: block;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.tips-reason p,
.tips-improve p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cat-mood-section {
        padding: 15px;
    }
    
    .score-display {
        font-size: 36px;
    }
    
    .cat-score-top h3 {
        font-size: 16px;
    }
    
    .cat-animation-container {
        max-width: 300px;
    }
    
    .tips-reason,
    .tips-improve {
        padding: 12px;
    }
    
    .tips-reason strong,
    .tips-improve strong {
        font-size: 13px;
    }
    
    .tips-reason p,
    .tips-improve p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cat-mood-section {
        padding: 12px;
    }
    
    .score-display {
        font-size: 32px;
    }
    
    .cat-animation-container {
        max-width: 250px;
    }
}

/* Legal Pages Styling */
.uk-article h1 {
    color: #333;
    margin-bottom: 10px;
}

.uk-article h2 {
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
}

.uk-article h3 {
    color: #555;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 18px;
}

.uk-article p {
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
}

.uk-article strong {
    color: #333;
}

.uk-article .uk-list-bullet {
    margin-left: 20px;
}

.uk-article .uk-list-bullet li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.uk-article a {
    color: var(--primary-color);
    text-decoration: none;
}

.uk-article a:hover {
    text-decoration: underline;
}

.uk-article a.uk-button {
    color: white !important;
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.uk-article a.uk-button:hover {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}