/* Tabs CSS for Knesset Timesheet System - FIXED ALIGNMENT */
/* COMPLETE FILE - Ready to replace your tabs.css */

/* Tabs Container */
.tabs-container {
  background: var(--knesset-white);
  border: 1px solid var(--knesset-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
}

/* Tab Navigation - Clean white background */
.tabs-nav {
  display: flex;
  background: var(--knesset-white);
  border-bottom: 2px solid var(--knesset-border);
  direction: rtl;
  position: relative;
  z-index: 2;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

/* Tab Buttons - MINIMAL APPROACH: Only text color changes */
.tab-btn {
  flex: 1;
  padding: 16px 20px 13px 20px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--knesset-border);
  border-bottom: 3px solid transparent;
  color: var(--knesset-text-light);
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  position: relative;
  text-align: center;
  font-family: 'SemanticaMedium', 'Arial Hebrew', Arial, sans-serif;
  white-space: nowrap;
  min-width: fit-content;
  flex-shrink: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: rtl;
  border-radius: 0;
}

/* First tab - top right corner rounded (RTL: rightmost tab) */
.tab-btn:first-child {
  border-right: none;
  border-top-right-radius: 8px;
}

.tab-btn:first-child.active {
  border-right: none;
  border-top-right-radius: 8px;
}

/* Last tab - top left corner rounded (RTL: leftmost tab) */
.tab-btn:last-child {
  border-left: none;
  border-top-left-radius: 8px;
}

.tab-btn:last-child.active {
  border-left: none;
  border-top-left-radius: 8px;
}

/* Minimal hover state - Only text color change */
.tab-btn:hover:not(.active) {
  color: var(--knesset-primary);
  z-index: 2;
}

/* Active state - Only bottom border and text changes */
.tab-btn.active {
  background: transparent;
  color: var(--knesset-primary);
  font-weight: 600;
  border-bottom: 3px solid var(--knesset-primary);
  z-index: 3;
  position: relative;
}

/* Remove the after element for active state */
.tab-btn.active::after {
  display: none;
}

/* No hover effects on active tabs */
.tab-btn.active:hover {
  background: transparent;
  color: var(--knesset-primary);
  border-bottom: 3px solid var(--knesset-primary);
}

/* Tab Content */
.tabs-content {
  padding: 0;
  position: relative;
}

/* Tab Panes */
.tab-pane {
  display: none;
  padding: 24px;
  background: var(--knesset-white);
  min-height: 120px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Tab Panes form groups use global form styling from styles.css */
.tab-pane .form-group {
  margin-bottom: 20px;
}

.tab-pane .form-group:last-child {
  margin-bottom: 0;
}

/* FIXED: Common fields styling - ALIGNED WITH TAB CONTENT */
.common-fields {
  /* Remove any background or border-top that creates visual separation */
  padding: 0 24px 24px 24px; /* Match tab-pane padding exactly */
  background: var(--knesset-white); /* Same as tab-pane background */
  /* Remove border-top to create seamless alignment */
}

.common-fields .form-group {
  margin-bottom: 20px;
}

.common-fields .form-group:first-child {
  margin-top: 0; /* Remove top margin to align with tab content */
}

/* Full width utility for common fields */
.full-width {
  width: 100%;
  margin-bottom: 16px;
}

.full-width:last-child {
  margin-bottom: 0;
}

/* Tab Icons */
.tab-btn::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
  flex-shrink: 0;
  order: -1;
}

/* Icon definitions */
.tab-btn[data-tab="month"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

.tab-btn[data-tab="assembly"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'%3E%3C/path%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'%3E%3C/path%3E%3C/svg%3E");
}

.tab-btn[data-tab="advanced"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E");
}

/* Focus states - Only outline, no background with rounded corners for first/last tabs */
.tab-btn:focus {
  outline: 2px solid var(--knesset-primary);
  outline-offset: -2px;
  z-index: 5;
}

/* First tab focus - rounded top right corner */
.tab-btn:first-child:focus {
  outline: 2px solid var(--knesset-primary);
  outline-offset: -2px;
  border-top-right-radius: 8px;
  z-index: 5;
}

/* Last tab focus - rounded top left corner */
.tab-btn:last-child:focus {
  outline: 2px solid var(--knesset-primary);
  outline-offset: -2px;
  border-top-left-radius: 8px;
  z-index: 5;
}

.tab-btn.active:focus {
  outline-color: var(--knesset-primary);
}

/* Active first tab focus - maintain rounded corner */
.tab-btn:first-child.active:focus {
  outline-color: var(--knesset-primary);
  border-top-right-radius: 8px;
}

/* Active last tab focus - maintain rounded corner */
.tab-btn:last-child.active:focus {
  outline-color: var(--knesset-primary);
  border-top-left-radius: 8px;
}

/* Enhanced button container for tabs */
.button-container {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-direction: row-reverse;
  margin-top: 20px;
}

/* Date range info styling for tabs */
.date-range-info {
  background: linear-gradient(135deg, var(--knesset-light-blue), #e8f4f8);
  color: var(--knesset-text);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--knesset-border);
  text-align: center;
  margin-bottom: 16px;
  font-family: 'SemanticaMedium', 'Arial Hebrew', Arial, sans-serif;
}

/* Date range display for assembly tab */
#dateRangeDisplayAssembly {
  background: linear-gradient(135deg, var(--knesset-light-blue), #e8f4f8);
  color: var(--knesset-text);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--knesset-border);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 20px;
}

/* Assembly tab specific styling */
#tab-assembly {
  min-height: 200px;
}

/* Tabs-specific loading animation */
.tabs-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235b9bbd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12c0 4.97-4.03 9-9 9s-9-4.03-9-9 4.03-9 9-9c.72 0 1.42.08 2.1.24'%3E%3C/path%3E%3C/svg%3E");
 /* animation: tabsRotate 1s linear infinite; */
}



/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .tabs-nav {
    flex-direction: column;
    border-radius: 8px 8px 0 0;
  }
  
  .tab-btn {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--knesset-border);
    border-top: none;
    padding: 12px 16px 15px 16px;
    flex: none;
    border-radius: 0;
  }
  
  /* Mobile: first tab gets top rounded corners */
  .tab-btn:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid var(--knesset-border);
  }
  
  /* Mobile: last tab no special rounding */
  .tab-btn:last-child {
    border-bottom: none;
    border-radius: 0;
  }
  
  .tab-btn.active {
    border-bottom: 1px solid var(--knesset-border);
    border-right: 3px solid var(--knesset-primary);
    padding-right: 13px;
  }
  
  /* Mobile active states maintain proper rounding */
  .tab-btn:first-child.active {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-right: 3px solid var(--knesset-primary);
    padding-right: 13px;
  }
  
  .tab-btn:last-child.active {
    border-bottom: none;
    border-radius: 0;
    border-right: 3px solid var(--knesset-primary);
    padding-right: 13px;
  }
  
  .tab-pane {
    padding: 16px;
  }
  
  /* FIXED: Mobile common fields alignment */
  .common-fields {
    padding: 0 16px 16px 16px; /* Match mobile tab-pane padding */
  }
  
  .tab-btn::before {
    width: 14px;
    height: 14px;
  }
  
  #tab-assembly {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .button-container {
    flex-direction: column;
    gap: 8px;
  }
  
  .button-container button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    font-size: 13px;
    padding: 10px 12px 13px 12px;
  }
  
  .tab-btn.active {
    padding-right: 9px;
    border-right: 3px solid var(--knesset-primary);
  }
  
  .tab-pane {
    padding: 12px;
    min-height: 100px;
  }
  
  /* FIXED: Extra small screen common fields alignment */
  .common-fields {
    padding: 0 12px 12px 12px; /* Match extra small tab-pane padding */
  }
  
  .tab-btn span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
  }
}
