/**
 * LemonFox Studio Styles
 *
 * Core styles for the Audiobook and Podcast Studio interfaces
 */

/* Overall Studio Layout */
.audiobook-studio {
  display: flex;
  min-height: 800px;
  margin: 0;
  padding: 30px;
  align-items: flex-start;
  max-width: 100vw;
  box-sizing: border-box;
}

#audiobook-studio-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#audiobook-studio-main {
  flex: 1;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  width: 0;
  min-width: 0;
  max-width: 100%;
}

/* Studio Sidebar */
#audiobook-studio-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 25px 20px;
  background-color: #1a1f36;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  margin-right: 25px;
  height: fit-content;
  position: sticky;
  top: 0px;
  color: white;
  align-self: flex-start;
}

.studio-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

#audiobook-studio-sidebar p {
  color: #b8c5d1;
  margin-bottom: 20px;
}

.studio-icon {
  margin-right: 10px;
  font-size: 24px;
}

.sidebar-section {
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 20px;
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 15px;
}

.stats-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: #b8c5d1;
  font-size: 14px;
}

.stat-value {
  font-weight: 500;
  color: white;
  font-size: 14px;
}

.current-project-title {
  font-weight: 600;
  font-size: 16px;
  color: #4f46e5;
  padding: 5px 0;
}

/* Sidebar Navigation */
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 5px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: #b8c5d1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Tab Navigation */
.studio-tabs {
  display: flex;
  background-color: #f0f0f0;
  padding: 15px 15px 0;
  margin-bottom: 0;
  border-bottom: 2px solid #4f46e5;
  width: 100%;
  box-sizing: border-box;
  gap: 2px; /* Reduced from 8px to 2px for tighter spacing */
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  justify-content: flex-start; /* Keep tabs left-aligned instead of spreading */
  flex-wrap: nowrap; /* Prevent wrapping */
}

.studio-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* Individual tab styling */
.studio-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e0e0e0;
  color: #000000;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  position: relative;
  z-index: 10;
  min-width: 80px;
  max-width: 140px; /* Prevent tabs from getting too wide */
  text-align: center;
  margin-right: 0;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0; /* Prevent tabs from shrinking too much */
  flex-grow: 0; /* Prevent tabs from growing to fill space */
}

/* Tab hover effect */
.studio-tab:hover {
  background-color: #f3f4f6;
  color: #4f46e5;
}

/* Active tab styling */
.studio-tab.active {
  background-color: white;
  color: #4f46e5;
  border-color: #4f46e5;
  border-top: 3px solid #4f46e5;
  font-weight: 600;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

/* White connector for active tab */
.studio-tab.active:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: white;
  z-index: 11;
}

/* Emoji styling */
.tab-emoji {
  margin-right: 8px;
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

/* Text styling */
.tab-text {
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  visibility: visible;
  opacity: 1;
  color: inherit;
}

/* Active tab text styling */
.studio-tab.active .tab-text {
  font-weight: 600;
}

/* Tab content container */
.studio-content-wrapper {
  background-color: white;
  border: 1px solid #d1d5db;
  border-top: none;
  padding: 20px;
  min-height: 600px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Tab content panels */
.studio-tab-content {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.studio-tab-content.active {
  display: block;
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background-color: #4338ca;
}

.btn-secondary {
  background-color: #ebeef8;
  color: #333;
}

.btn-secondary:hover {
  background-color: #dce0f2;
}

.btn-text-only {
  background: none;
  border: none;
  color: #4f46e5;
  padding: 0;
  font-weight: 500;
  cursor: pointer;
}

.btn-text-only:hover {
  text-decoration: underline;
}

/* Global container constraints */
.studio-tab-content * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Ensure all grid containers are responsive */
.studio-tab-content .analytics-grid,
.studio-tab-content .settings-grid,
.studio-tab-content .tools-grid,
.studio-tab-content .audio-controls,
.studio-tab-content .audio-workspace,
.studio-tab-content .chapter-stats,
.studio-tab-content .timeline-container,
.studio-tab-content .task-list,
.studio-tab-content .settings-list,
.studio-tab-content .platform-list {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Prevent wide elements from overflowing */
.studio-tab-content input,
.studio-tab-content select,
.studio-tab-content textarea,
.studio-tab-content .form-control {
  max-width: 100%;
  box-sizing: border-box;
}

/* Fix grid containers on small screens */
@media (max-width: 768px) {
  .studio-tab-content .analytics-grid,
  .studio-tab-content .settings-grid,
  .studio-tab-content .tools-grid,
  .studio-tab-content .audio-controls,
  .studio-tab-content .audio-workspace,
  .studio-tab-content .chapter-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .audiobook-studio {
    flex-direction: column;
  }
  
  #audiobook-studio-sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 25px;
    position: static;
  }
  
  .studio-tabs {
    padding: 10px 10px 0;
  }
  
  .studio-tab {
    padding: 10px 15px;
    min-width: 80px;
  }
}

/* Enhanced Mobile Touch Improvements */
@media (max-width: 768px) {
  /* Better touch targets for tabs */
  .studio-tab {
    padding: 14px 18px !important;
    min-width: 90px !important;
    font-size: 15px !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Enhanced tap feedback */
  .studio-tab:active {
    transform: scale(0.98);
    background-color: #e5e7eb !important;
    transition: all 0.1s ease;
  }
  
  /* Better button touch targets */
  .btn {
    min-height: 48px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
  }
  
  /* Improved form controls for mobile */
  .form-control {
    min-height: 48px !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }
  
  /* Enhanced scroll indicators */
  .studio-tabs::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, #f0f0f0);
    pointer-events: none;
  }
  
  /* Better content spacing */
  .studio-content-wrapper {
    padding: 15px !important;
  }
}

/* Small mobile optimizations */
@media (max-width: 480px) {
  /* Even better touch targets for very small screens */
  .studio-tab {
    padding: 16px 12px !important;
    min-width: 70px !important;
    font-size: 14px !important;
  }
  
  /* Smaller emoji for space efficiency */
  .tab-emoji {
    font-size: 16px !important;
    margin-right: 6px !important;
  }
  
  /* Condensed tab text on very small screens */
  .tab-text {
    font-size: 13px !important;
  }
  
  /* Better mobile content padding */
  .studio-content-wrapper {
    padding: 12px !important;
  }
  
  /* Improved button spacing */
  .btn {
    margin-bottom: 10px !important;
  }
}