/* Global styles */
body {
    font-family: Arial, sans-serif;
}

/* Navbar styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.app-logo:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
    transform: scale(1.05);
}

#invite-btn {
    display: none;
    position: static;
}

/* User sidebar styles */
.user-sidebar {
    margin-top: -1.5rem;
}

.user-sidebar .sticky-header {
    z-index: 2;
}

/* Users list */
.user-list-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Fibonacci buttons styles */
.fib-buttons-container {
    max-width: 900px;
}

.fib-button {
    min-width: 90px;
    font-size: 2rem;
    padding: 1.2rem 2.2rem;
    transition: transform 0.1s, background 0.15s;
}

.fib-button:hover {
    transform: scale(1.08);
}

.fib-button.selected {
    transform: scale(1.08);
}

/* Flip section styles */
#flip-section {
    display: none;
}

.reset-btn {
    display: none;
}

/* Modal styles */
.modal-content {
    border-radius: 0.5rem;
}

/* Login page styles */
.login-container {
    min-height: 100vh;
}

.login-card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#roomForm, #loginForm {
    display: none;
}

#roomForm.show, #loginForm.show {
    display: block;
}

/* User row styles */
.user-row {
    position: relative;
    height: 40px;
}

/* Make user name look clickable when actions are available */
.user-row .fw-semibold.clickable { cursor: pointer; text-decoration: underline dotted; }

.user-remove-btn {
    opacity: 0;
    transition: opacity 0.2s;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.user-row:hover .user-remove-btn {
    opacity: 1;
}

/* Voting stats styles */
.voting-stats {
    display: none;
}

.stats-progress-bar {
    height: 8px;
}

/* Utility classes */
.min-height-0 {
    min-height: 0;
}

/* Responsive adjustments: MOBILE ONLY */
@media (max-width: 768px) {
    /* Move current user display under logo, keep Logout on the right */
    .navbar .container-fluid { flex-wrap: wrap; }
    #current-user-display { display: none !important; }
    #logout-link {
        order: 2;
        margin-left: auto !important;
    }

    /* Mobile: show only icon for Set admin button */
    .user-promote-btn { padding: 2px 6px; min-width: auto; }
    .user-promote-btn .btn-label { display: none; }
    .user-promote-btn i { font-size: 1rem; margin: 0; }
    /* Sidebar spacing and users list behavior on mobile */
    .user-sidebar { margin-top: 0; }
    .user-list-container { 
        max-height: 40vh; 
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce overall container height on mobile */
    .container-fluid.min-vh-100 { min-height: auto !important; }
    .user-sidebar.min-vh-100 { min-height: auto !important; }

    /* Show admin/user badge in navbar header on mobile */
    #current-user-type { display: inline-block !important; }

    /* Make voting area mobile friendly */
    .fib-buttons-container {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 0.5rem;
        max-width: 100%;
        padding: 0 0.5rem;
        margin-top: 1rem;
    }
    .fib-button {
        min-width: auto;
        font-size: 1.25rem;
        padding: 0.9rem 0.9rem;
        margin: 0 !important;
    }
    #flip-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem !important;
    }
    #flip-section .btn {
        padding: 0.75rem 1.25rem;
        width: 100%;
        max-width: 260px;
    }
    /* Avoid navbar overflow on small screens */
    #invite-btn { left: 0; }
}

@media (max-width: 400px) {
    .fib-buttons-container {
        grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
        gap: 0.4rem;
    }
    .fib-button {
        font-size: 1.1rem;
        padding: 0.7rem 0.7rem;
    }
}
  
  /* Brand button color to match logo (#375a7f) using Bootstrap button variables */
  .btn-brand {
      --bs-btn-color: #ffffff;
      --bs-btn-bg: #375a7f;
      --bs-btn-border-color: #375a7f;
      --bs-btn-hover-color: #ffffff;
      --bs-btn-hover-bg: #2f4f6d;
      --bs-btn-hover-border-color: #2f4f6d;
      --bs-btn-focus-shadow-rgb: 55, 90, 127;
      --bs-btn-active-color: #ffffff;
      --bs-btn-active-bg: #2b485f;
      --bs-btn-active-border-color: #2b485f;
      --bs-btn-disabled-color: #ffffff;
      --bs-btn-disabled-bg: #375a7f;
      --bs-btn-disabled-border-color: #375a7f;
  }

  /* Loading overlay */
  .loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(55, 90, 127, 0.85);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2000;
  }
  .loading-overlay.show { display: flex; }
  .loading-content { transform: translateY(-10%); }

  