/* Enhanced typography for premium feel */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #fafbfd 0%, #f4f6f9 100%);
    color: #1a1a1a;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.container {
    max-width: 800px;
}

/* Premium top bar */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 253, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid rgba(10, 102, 195, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* max-width: 800px; */
    margin: 0 auto;
    gap: 1rem;
}

#userName {
    color: #0A66C3;
    font-weight: 600;
    font-size: 0.9rem;
}

#userAvatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(10, 102, 195, 0.2);
    transition: all 0.3s ease;
}

#userAvatar:hover {
    border-color: rgba(10, 102, 195, 0.4);
    transform: scale(1.05);
}

/* Premium logout button */
#logoutButton {
    background: linear-gradient(135deg, #0A66C3 0%, #1976D2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(10, 102, 195, 0.2);
}

#logoutButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 102, 195, 0.3);
}

/* User section styling for proper header alignment */
.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Menu toggle button styling */
.menu-toggle {
    background: linear-gradient(135deg, #0A66C3 0%, #1976D2 100%);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(10, 102, 195, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(10, 102, 195, 0.3);
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.menu-button {
    border-radius: 8px;
    background-color: #f0f4f8;
    color: #0A66C3;
    padding: 0.75rem 1.5rem;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.menu-button:hover, .menu-button.active {
    background-color: #c1d7eee6;
}

nav {
    flex-direction: row;
    border-bottom: none;
    display: flex;
    justify-content: center;
  }

.logoutButton {
    background-color: #9e9e9e24;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    transition: background-color 0.3s ease;
    font-family: Arial, sans-serif;
    font-size: 14px;
    justify-self: flex-end;
}

.logoutButton:hover {
    background-color: #c7c6c699;
}

.logoutButton svg {
    width: 20px;
    height: 20px;
    /* margin-right: 5px; */
}

.menu-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    flex-shrink: 0;
}

.stakeholder-icon, .preferences-icon {
    width: 24px;
    height: 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.logo-section {
display: flex;
align-items: center;
}

.app-logo {
height: 2rem;
width: auto;
margin-right: 0.5rem;
}


/* General app-title styling for nano-app cards and other components */
.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1a1a1a 0%, #0A66C3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-left: 200px;
    padding: 0;
}

.frame-wrapper,
.rectangle-parent {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  width: fit-content;
}

.rectangle-parent {
    cursor: pointer;
    border: 0px solid #000;
    padding: 7px 14px;
    /* background-color: transparent; */
    width: 127px;
    border-radius: 22px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    background: rgba(216, 229, 244, 1);
}

.ouiarrow-up-wrapper {
    width: 11px;
    height: 18px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    object-fit: contain;
    z-index: 2;
}

.ouiarrow-up-icon {
    width: 16px;
    height: 21px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    object-fit: contain;
    z-index: 1;
    justify-content: center;
    align-items: center;
  }

  .ouiarrow-up-icon.hover,.ouiarrow-up-wrapper:hover {
    display: none; /* Ensure this is hidden by default */
  }

  .back {
    text-decoration: none;
    position: relative;
    font-size: 14px;
    color: #000;
    text-align: left;
    display: inline-block;
    /* min-width: 39px; */
    z-index: 0;
    line-height: 21px;
    letter-spacing: 0.02em;
}

.rectangle-parent:hover {
    color: var(--bg-s, #FFF);
    cursor: pointer;
    box-shadow: 0px 4px 4px 0px rgba(10, 102, 195, 0.50);
    /* border-radius: 22px; */
    /* border: 1.5px solid #0075EA; */
    background: var(--Linear, linear-gradient(114deg, rgba(10, 102, 195, 0.90) -20.72%, rgba(10, 102, 195, 0.45) 127.18%, rgba(10, 102, 195, 0.01) 275.09%));
}

.rectangle-parent:hover .back {
    color: white;
}

.rectangle-parent:hover .ouiarrow-up-icon.normal {
    display: none;
}

.rectangle-parent:hover .ouiarrow-up-icon.hover {
    display: block;
}

#groupTitle {
    color: #0A66C3;
}

.update-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(150%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    border: 2px solid #0A66C3;
}

.update-popup.show {
    transform: translateY(0);
}

.update-popup-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.update-popup-title {
    font-weight: 600;
    color: #0A66C3;
    font-size: 16px;
    margin: 0;
}

.update-popup-message {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.update-popup-button {
    background: #0A66C3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.update-popup-button:hover {
    background: #0850a0;
}

.update-icon {
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.update-details {
    font-size: 0.9em;
    color: #666;
    margin: 8px 0;
    line-height: 1.4;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0A66C3;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loading-content h2 {
    color: #0A66C3;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.loading-content p {
    color: #666;
    margin: 0;
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25); /* Light transparent background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.auth-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(10, 102, 195, 0.1);
    border-top: 3px solid #0A66C3;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.auth-content h2 {
    color: #0A66C3;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 500;
}

.auth-content p {
    color: #4B5563;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.blur-background {
    filter: blur(4px);
    transition: filter 0.3s ease-in-out;
}

.auth-overlay.fade-out {
    opacity: 0;
}

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

.activity-credits {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
}

.credit-icon {
    fill: currentColor;
}

.markdown-content {
    line-height: 1.6;
    font-size: 15px;
    display: block !important;
  }
  .markdown-content code {
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
  }
  .markdown-content pre {
    background-color: #f6f8fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
  }
  .markdown-content blockquote {
    border-left: 4px solid #dfe2e5;
    padding-left: 16px;
    color: #6a737d;
    margin: 16px 0;
  }
  .markdown-content ul, .markdown-content ol {
    padding-left: 2em;
  }
  .markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
  }
  .markdown-content th, .markdown-content td {
    border: 1px solid #dfe2e5;
    padding: 6px 13px;
  }
  .markdown-content th {
    background-color: #f6f8fa;
  }

/* Enhanced content area */
#content {
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    transition: all 0.3s ease;
}

/* Pre-login state - no margin-top for landing page */
#content.pre-login {
    margin-top: 0;
    min-height: 100vh;
}

/* Premium menu icon styling */
.premium-menu-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.premium-menu-btn:hover .premium-menu-icon {
    transform: scale(1.05);
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(10, 102, 195, 0.3));
}

.premium-menu-btn:hover .premium-menu-icon path,
.premium-menu-btn:hover .premium-menu-icon circle,
.premium-menu-btn:hover .premium-menu-icon rect,
.premium-menu-btn:hover .premium-menu-icon line {
    fill: #1976D2;
    stroke: #1976D2;
}

.premium-menu-btn.active .premium-menu-icon {
    transform: scale(1.02);
    filter: brightness(1.05) drop-shadow(0 2px 6px rgba(10, 102, 195, 0.4));
}

.premium-menu-btn.active .premium-menu-icon path,
.premium-menu-btn.active .premium-menu-icon circle,
.premium-menu-btn.active .premium-menu-icon rect,
.premium-menu-btn.active .premium-menu-icon line {
    fill: #0A66C3;
    stroke: #0A66C3;
}

/* Enhanced loading states */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fafbfd 0%, #f4f6f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #0A66C3;
    font-size: 1.1rem;
}

/* Premium scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 102, 195, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(10, 102, 195, 0.3) 0%, rgba(25, 118, 210, 0.3) 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(10, 102, 195, 0.5) 0%, rgba(25, 118, 210, 0.5) 100%);
}

/* Enhanced focus states */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid rgba(10, 102, 195, 0.4);
    outline-offset: 2px;
}

/* Premium text selection */
::selection {
    background: rgba(10, 102, 195, 0.2);
    color: #0A66C3;
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Premium responsive adjustments */
@media (max-width: 768px) {
    #top-bar {
        padding: 0 16px;
        height: 56px;
        min-height: 56px;
        flex-wrap: nowrap;
    }
    
    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    

#content {
  margin-top: clamp(56px, 8vw, 64px);
  min-height: calc(100vh - clamp(56px, 8vw, 64px));
  padding: var(--space-lg);
}

/* Use foundation spacing for existing elements */
.home-container {
  padding: var(--space-xl);
  margin: var(--space-lg) auto;
  background: linear-gradient(135deg, #fafbfd 0%, #f4f6f9 100%);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
}

.welcome-header {
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, rgba(10, 102, 195, 0.03) 0%, rgba(25, 118, 210, 0.05) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(10, 102, 195, 0.08);
}

.home-container h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: #1a1a1a;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1a1a1a 0%, #0A66C3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: var(--text-lg);
  color: #546e7a;
  line-height: 1.6;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto var(--space-xl) auto;
}

.nav-buttons {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  padding: 0 var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.premium-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfd 100%);
  border: 1px solid rgba(10, 102, 195, 0.12);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  min-height: 180px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.premium-icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: #1f2937;
}

.card-subtitle {
  font-size: var(--text-base);
  color: #6b7280;
  margin-bottom: var(--space-md);
}

.card-description {
  font-size: var(--text-sm);
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* Mobile responsive adjustments using foundation */
@media (max-width: 480px) {
  #content {
    margin-top: 60px;
    padding: var(--space-md);
  }
  
  .home-container {
    margin: var(--space-sm);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
  }
  
  .welcome-header {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
  }
  
  .home-container h2 {
    font-size: var(--text-2xl);
  }
  
  .welcome-subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
  }
  
  .nav-buttons {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-top: var(--space-lg);
  }
  
  .premium-card {
    padding: var(--space-lg);
    min-height: 160px;
  }
  
  .premium-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
  }
  
  .card-title {
    font-size: var(--text-lg);
  }
  
  .card-subtitle {
    font-size: var(--text-sm);
  }
  
  .card-description {
    font-size: var(--text-xs);
  }
}

/* Tablet responsive adjustments */
@media (min-width: 481px) and (max-width: 768px) {
  #content {
    margin-top: 64px;
    padding: var(--space-lg);
  }
  
  .home-container {
    margin: var(--space-md);
    padding: var(--space-xl);
  }
  
  .nav-buttons {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
  }
  
  .premium-card {
    padding: var(--space-xl);
    min-height: 170px;
  }
  
  .premium-icon {
    width: 52px;
    height: 52px;
  }
}


/* Mobile title */
@media (max-width: 480px) {
  #top-bar .app-title {
    font-size: var(--text-lg);
    max-width: 150px;
  }
}

/* Tablet and desktop title */
@media (min-width: 481px) {
  #top-bar .app-title {
    font-size: var(--text-xl);
    max-width: none;
  }
}


/* Mobile title - force override */
@media (max-width: 480px) {
  #top-bar .app-title {
    font-size: var(--text-lg) !important;
    max-width: 150px !important;
  }
}

/* Tablet and desktop title - force override */
@media (min-width: 481px) {
  #top-bar .app-title {
    font-size: var(--text-xl) !important;
    max-width: none !important;
  }
}

/* Simple responsive title */
#top-bar .app-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  #top-bar .app-title {
    max-width: 150px;
    font-size: 1rem;
  }
}
