/* CSS INNER PAGES */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Make the page container fill the viewport height */
.page-container {
  display: flex;
  flex-direction: column;

}

/* Header & footer are normal blocks at top/bottom */
header, footer {
  flex: 0 0 auto; /* they take as much height as needed */
}

/* Middle flex container (sidebar + main) fills leftover vertical space */
.layout-container {
  display: flex;
  flex: 1 0 auto; /* occupy remaining space between header & footer */
}

/* Sidebar */
.sidebar {
  background-color: #343a40;
  color: #fff;
  width: 60px; /* collapsed width */
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* hide text when collapsed */
}

/* Expanded sidebar */
.sidebar.expanded {
  width: 200px;
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 15px;
  text-decoration: none;
  color: inherit;
}

.sidebar-item:hover {
  background-color: #495057;
}

/* Hide text by default, only show when expanded */
.sidebar .sidebar-text {
  margin-left: 10px;
  display: none;
  white-space: nowrap;
}

.sidebar.expanded .sidebar-text {
  display: inline;
}

/* Push the bottom links (Settings, Logout, Toggle) to the bottom */
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

/* Toggle arrow styling */
.sidebar-toggle {
  text-align: center;
  cursor: pointer;
  padding: 10px 0;
  border-top: 1px solid #495057;
}

/* Main Content */
.main-content {
  flex: 1;         /* fill the rest of the horizontal space */
  overflow-y: auto; /* scroll if needed */
  background: #f8f9fa;
  /* remove large margin classes if they cause extra whitespace */
}

.container {
  /* If you want some top/bottom spacing, keep it minimal 
     or use padding instead of large margin classes like my-5 */
  padding: 20px;
}
@media (max-width: 576px) {
  /* Keep the flex layout to maintain full height */
  html, body {
    height: 100% !important; /* Keep this as 100% instead of auto */
    margin: 0;
    padding: 0;
  }
  
  /* Keep the page container as flex to allow stretching */
  .page-container {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100% !important;
  }
  
  /* Make the layout container take available space */
  .layout-container {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
  }
  
  /* Adjust sidebar for mobile while keeping flex layout */
  .sidebar {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 10px 0;
    flex: 0 0 auto !important;
  }
  
  /* Keep main content flexible */
  .main-content {
    flex: 1 0 auto !important;
  }
  
  /* Footer stays at bottom */
  footer {
    flex-shrink: 0;
  }
}

/* Platform card colors */
.platform-icon {
  transition: all 0.3s ease;
}
.platform-icon.twitter-bg {
  background-color: #1DA1F2;
}
.platform-icon.linkedin-bg {
  background-color: #0A66C2;
}
.platform-icon.bluesky-bg {
  background-color: #0085ff;
}

/* Card and container enhancements */
.card {
  transition: all 0.3s ease;
}
.card.border-0 {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
.card-header.bg-white {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Enhanced table styling */
.table-hover tbody tr {
  transition: background-color 0.2s;
}
.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.03);
}
.table thead tr th {
  font-weight: 600;
  color: #495057;
}

/* Badges and status indicators */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}
.badge.rounded-pill {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.badge.bg-warning {
  background-color: #ffc107 !important;
}
.badge.bg-success {
  background-color: #28a745 !important;
}
.badge.bg-danger {
  background-color: #dc3545 !important;
}
.badge.bg-light {
  background-color: #f8f9fa !important;
  color: #212529;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Progress bar enhancements */
.progress {
  background-color: rgba(0, 0, 0, 0.05);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  transition: width 0.6s ease;
}

/* Button enhancements */
.btn {
  font-weight: 500;
  transition: all 0.2s;
}
.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}
.btn-primary:hover {
  background-color: #0b5ed7;
  filter: brightness(95%);
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.3rem;
}
.btn.rounded-pill {
  border-radius: 50rem !important;
}
.btn-light {
  background-color: #f8f9fa;
  border-color: #f8f9fa;
}
.btn-light:hover {
  background-color: #e2e6ea;
  border-color: #dae0e5;
}

/* Dropdown menu styling */
.dropdown-menu {
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: none;
  padding: 0.5rem 0;
}
.dropdown-item {
  padding: 0.5rem 1rem;
  transition: background-color 0.2s;
}
.dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.05);
}
.dropdown-item i {
  width: 1rem;
  text-align: center;
}

/* Empty state styling */
.bg-light.rounded-circle {
  transition: all 0.3s ease;
}
.bg-light.rounded-circle:hover {
  background-color: #e9ecef !important;
}

/* Enhanced modals */
#editPostModal .modal-content {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
#editPostModal .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}
#editPostModal .modal-body {
  padding: 1.5rem;
}
#editPostModal .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.5rem;
}

/* Form styling for modals */
.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.form-control {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}
.form-control:focus {
  border-color: rgba(0, 123, 255, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
}
textarea.form-control {
  line-height: 1.5;
}

/* Edit history section */
.edit-history-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.table-sm td, .table-sm th {
  padding: 0.5rem;
}

/* Toast notifications enhancement */
.toast {
  border-radius: 0.75rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: none;
  background-color: white;
}
.toast-header {
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.toast-body {
  padding: 1rem;
}

/* Enhanced integration card styling */
.integration-card {
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

.integration-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.platform-icon {
  transition: all 0.3s ease;
}

.integration-card:hover .platform-icon {
  transform: scale(1.1);
}

.connected-info {
  transition: all 0.2s;
}

.integration-card:hover .connected-info {
  background-color: rgba(0, 123, 255, 0.05) !important;
}

/* Button styles */
.btn {
  transition: all 0.2s;
}

.btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-outline-danger:hover {
  color: white;
  background-color: #dc3545;
  border-color: #dc3545;
}

/* Loading state for buttons */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading:after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  left: calc(50% - 0.5rem);
  top: calc(50% - 0.5rem);
  animation: button-loading-spinner 0.75s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

/* Coming soon badges */
.coming-soon-badge {
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* Avatar placeholders */
.avatar-placeholder {
  font-weight: bold;
  text-transform: uppercase;
}

/* Refresh button animation */
#refreshIntegrationsBtn .fa-sync-alt {
  transition: transform 0.5s ease;
}

#refreshIntegrationsBtn:hover .fa-sync-alt {
  transform: rotate(180deg);
}

#refreshIntegrationsBtn.refreshing .fa-sync-alt {
  animation: rotating 1s linear infinite;
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Toast enhancements */
.toast {
  border-radius: 0.75rem;
  border: none;
  background: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.toast-header {
  border-radius: 0.75rem 0.75rem 0 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Modal enhancements */
.modal-content {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.platform-icon-large {
  transition: transform 0.3s ease;
}

#unlinkConfirmModal:hover .platform-icon-large {
  transform: rotate(15deg);
}

/* Platform specific hover effects */
.integration-card[data-platform="twitter"]:hover {
  border-color: #1DA1F2 !important;
}

.integration-card[data-platform="bluesky"]:hover {
  border-color: #0085ff !important;
}

.integration-card[data-platform="linkedin"]:hover {
  border-color: #0A66C2 !important;
}

.integration-card[data-platform="facebook"]:hover {
  border-color: #1877F2 !important;
}

.integration-card[data-platform="threads"]:hover {
  border-color: #000000 !important;
}

.integration-card[data-platform="mastodon"]:hover {
  border-color: #563ACC !important;
}