/**
 * Portal Styles
 * Following STYLE_GUIDE.md design system
 */

/* Typography Classes (from style guide) */
.HeadingH1 {
  font-size: 64px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.02em;
}

.HeadingH2 {
  font-size: 56px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.02em;
}

.HeadingH3 {
  font-size: 48px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.02em;
}

.HeadingH4 {
  font-size: 40px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  letter-spacing: -0.02em;
}

.HeadingH5 {
  font-size: 32px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  letter-spacing: -0.02em;
}

.HeadingH6 {
  font-size: 24px;
  font-family: Manrope;
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.05em;
}

.bodyRegularXLarge {
  font-size: 20px;
  font-family: "DM Sans";
  font-weight: 400;
  line-height: 155%;
  letter-spacing: -0.02em;
}

.bodyRegularLarge {
  font-size: 18px;
  font-family: Montserrat;
  font-weight: 400;
  line-height: 155%;
  letter-spacing: -0.02em;
}

.bodyRegularMedium {
  font-size: 16px;
  font-family: "DM Sans";
  font-weight: 400;
  line-height: 155%;
  letter-spacing: -0.03em;
}

.bodyRegularSmall {
  font-size: 14px;
  font-family: "DM Sans";
  font-weight: 400;
  line-height: 155%;
  letter-spacing: -0.02em;
}

.bodySemiboldXlarge {
  font-size: 20px;
  font-family: "Barlow Condensed";
  font-weight: 700;
  line-height: 120%;
}

.bodySemiboldMedium {
  font-size: 16px;
  font-family: "DM Sans";
  font-weight: 600;
  line-height: 155%;
  letter-spacing: -0.02em;
}

.bodySemiboldSmall {
  font-size: 14px;
  font-family: "DM Sans";
  font-weight: 600;
  line-height: 155%;
  letter-spacing: -0.03em;
}

.bodymediumMedium {
  font-size: 16px;
  font-family: "DM Sans";
  font-weight: 500;
  line-height: 155%;
  letter-spacing: -0.03em;
}

/* Portal Container */
.portal-container {
  width: 100%;
  min-height: 100vh;
  background-color: rgba(251, 250, 249, 1);
  padding: 40px 80px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Body reset for portal pages */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Auth Wrapper */
.portal-auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 20px 0;
  box-sizing: border-box;
}

.portal-auth-card {
  width: 100%;
  max-width: 500px;
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0px 3.84px 8px 0px rgba(177, 177, 177, 0.1);
  box-sizing: border-box;
  margin: 0 auto;
}

.portal-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.portal-auth-header h1 {
  margin-bottom: 16px;
}

.portal-auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(220, 220, 220, 1);
}

.portal-auth-footer a {
  color: rgba(51, 135, 65, 1);
  text-decoration: none;
  transition: color 0.2s ease;
}

.portal-auth-footer a:hover {
  color: rgba(42, 115, 55, 1);
}

/* Tabs */
.portal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(220, 220, 220, 1);
  position: relative;
  z-index: 10;
}

.portal-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: "DM Sans";
  font-size: 16px;
  font-weight: 500;
  color: rgba(5, 5, 5, 1);
  transition: color 0.2s ease, border-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.portal-tab:hover {
  color: rgba(51, 135, 65, 1);
}

.portal-tab.active {
  color: rgba(51, 135, 65, 1);
  border-bottom-color: rgba(51, 135, 65, 1);
}

.portal-badge {
  background-color: rgba(51, 135, 65, 1);
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.portal-tab-content {
  display: none !important;
}

.portal-tab-content.active {
  display: block !important;
}

/* Forms */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.portal-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-form-group label {
  color: rgba(5, 5, 5, 1);
}

.portal-form-group small {
  color: rgba(97, 97, 97, 1);
  margin-top: -4px;
}

.portal-input,
.portal-textarea {
  padding: 12px 16px;
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 6px;
  font-family: "DM Sans";
  font-size: 16px;
  font-weight: 400;
  color: rgba(5, 5, 5, 1);
  background-color: rgba(255, 255, 255, 1);
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.portal-input:focus,
.portal-textarea:focus {
  outline: none;
  border-color: rgba(51, 135, 65, 1);
}

.portal-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-family: "DM Sans";
  font-size: 16px;
  font-weight: 500;
}

.portal-button:active {
  transform: scale(0.98);
}

.portal-button-primary {
  background-color: rgba(51, 135, 65, 1);
  color: rgba(255, 255, 255, 1);
}

.portal-button-primary:hover {
  background-color: rgba(42, 115, 55, 1);
}

.portal-button-secondary {
  background-color: transparent;
  color: rgba(5, 5, 5, 1);
  border: 1px solid rgba(5, 5, 5, 1);
}

.portal-button-secondary:hover {
  background-color: rgba(243, 244, 246, 1);
}

.portal-button-danger {
  background-color: rgba(220, 38, 38, 1);
  color: rgba(255, 255, 255, 1);
}

.portal-button-danger:hover {
  background-color: rgba(185, 28, 28, 1);
}

/* Messages */
.portal-message {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.portal-message-error {
  background-color: rgba(254, 242, 242, 1);
  border: 1px solid rgba(248, 113, 113, 1);
  color: rgba(185, 28, 28, 1);
}

.portal-message-success {
  background-color: rgba(240, 253, 244, 1);
  border: 1px solid rgba(74, 222, 128, 1);
  color: rgba(22, 101, 52, 1);
}

/* Header */
.portal-header {
  margin-bottom: 32px;
}

.portal-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Sections */
.portal-section {
  margin-bottom: 48px;
}

.portal-section h2 {
  margin-bottom: 16px;
}

.portal-section p {
  margin-bottom: 24px;
  color: rgba(97, 97, 97, 1);
}

/* Jobs Grid */
.portal-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
  width: 100%;
}

/* When calendar is rendered, override grid layout */
.portal-jobs-grid:has(.portal-calendar) {
  display: block;
  width: 100%;
}

.portal-job-card {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.portal-job-card:hover {
  box-shadow: 0px 4px 12px 0px rgba(177, 177, 177, 0.15);
  transform: translateY(-2px);
}

.portal-job-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-job-card-title {
  margin: 0;
  color: rgba(5, 5, 5, 1);
}

.portal-job-card-location {
  color: rgba(97, 97, 97, 1);
}

.portal-job-card-description {
  flex-grow: 1;
  color: rgba(97, 97, 97, 1);
  line-height: 1.6;
}

.portal-job-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(243, 244, 246, 1);
}

.portal-job-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.portal-job-status-pending {
  background-color: rgba(254, 243, 199, 1);
  color: rgba(146, 64, 14, 1);
}

.portal-job-status-approved {
  background-color: rgba(240, 253, 244, 1);
  color: rgba(22, 101, 52, 1);
}

.portal-job-status-denied {
  background-color: rgba(254, 242, 242, 1);
  color: rgba(185, 28, 28, 1);
}

.portal-job-status-completed {
  background-color: rgba(243, 244, 246, 1);
  color: rgba(97, 97, 97, 1);
}

.portal-job-card-completed {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.portal-job-card-completed:hover {
  opacity: 0.7;
  transform: none;
}

/* Applications List */
.portal-applications-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.portal-application-card {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-application-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-application-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-application-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(243, 244, 246, 1);
}

/* Workmen List */
.portal-workmen-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.portal-workman-card {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.portal-workman-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-workman-actions {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Loading & Empty States */
.portal-loading,
.portal-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(97, 97, 97, 1);
}

/* Responsive Design */
@media (max-width: 1023px) {
  .portal-container {
    padding: 32px 40px;
  }
  
  .portal-auth-wrapper {
    min-height: calc(100vh - 64px);
    padding: 16px 0;
  }
  
  .HeadingH3 {
    font-size: 40px;
  }
  
  .HeadingH4 {
    font-size: 32px;
  }
}

@media (max-width: 767px) {
  .portal-container {
    padding: 24px 20px;
  }
  
  .portal-auth-wrapper {
    min-height: calc(100vh - 48px);
    padding: 12px 0;
    align-items: flex-start;
    padding-top: 20px;
  }
  
  .portal-auth-card {
    padding: 32px 24px;
    margin: 0;
  }
  
  .HeadingH3 {
    font-size: 36px;
  }
  
  .HeadingH4 {
    font-size: 28px;
  }
  
  .portal-jobs-grid {
    grid-template-columns: 1fr;
  }
  
  .portal-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .portal-tabs {
    flex-wrap: wrap;
  }
  
  .portal-application-header,
  .portal-workman-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .portal-workman-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .portal-workman-actions .portal-button {
    width: 100%;
  }
  
  .portal-application-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .portal-application-actions .portal-button {
    width: 100%;
  }
}

@media (max-width: 479px) {
  .portal-container {
    padding: 16px;
  }
  
  .portal-auth-wrapper {
    min-height: calc(100vh - 32px);
    padding: 8px 0;
    padding-top: 16px;
  }
  
  .portal-auth-card {
    padding: 24px 16px;
    border-radius: 12px;
  }
  
  .portal-auth-header {
    margin-bottom: 24px;
  }
  
  .HeadingH3 {
    font-size: 32px;
  }
  
  .HeadingH4 {
    font-size: 24px;
  }
  
  .bodySemiboldXlarge {
    font-size: 18px;
  }
  
  .portal-form {
    gap: 20px;
  }
}

/* Database Management Link */
.portal-db-management-link {
  margin-top: 16px;
  text-align: center;
  position: relative;
  z-index: 0;
}

.portal-button-link {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: rgba(97, 97, 97, 1);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.portal-button-link:hover {
  color: rgba(51, 51, 51, 1);
  text-decoration: underline;
}

.portal-button-link:focus {
  outline: none;
  color: rgba(51, 135, 65, 1);
}

/* Modal Styles */
.portal-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10000 !important;
  display: none !important;
  align-items: center;
  justify-content: center;
}

.portal-modal.show {
  display: flex !important;
}

.portal-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.portal-modal-content {
  position: relative;
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0px 3.84px 8px 0px rgba(177, 177, 177, 0.1);
  z-index: 1001;
}

.portal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid rgba(220, 220, 220, 1);
}

.portal-modal-header h2 {
  margin: 0;
}

.portal-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: rgba(97, 97, 97, 1);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.portal-modal-close:hover {
  color: rgba(51, 51, 51, 1);
}

.portal-modal-body {
  padding: 24px;
}

/* Management Page */
.portal-db-management {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.portal-warning-box {
  background-color: rgba(255, 243, 224, 1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.portal-warning-box p {
  margin: 0;
  color: rgba(133, 100, 4, 1);
}

.portal-warning-box p:not(:last-child) {
  margin-bottom: 8px;
}

.portal-file-input {
  padding: 12px 16px;
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 6px;
  font-family: "DM Sans";
  font-size: 16px;
  color: rgba(51, 51, 51, 1);
  background-color: rgba(249, 249, 249, 1);
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.portal-file-input:hover {
  background-color: rgba(245, 245, 245, 1);
}

.portal-file-input:focus {
  outline: none;
  border-color: rgba(51, 135, 65, 1);
  background-color: rgba(255, 255, 255, 1);
}

/* Responsive Modal */
@media (max-width: 767px) {
  .portal-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .portal-modal-header {
    padding: 20px 20px 12px 20px;
  }
  
  .portal-modal-body {
    padding: 20px;
  }
  
  .portal-db-management {
    gap: 24px;
  }
}

@media (max-width: 479px) {
  .portal-modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .portal-modal-header {
    padding: 16px;
  }
  
  .portal-modal-body {
    padding: 16px;
  }
}

/* Forgot Password Link */
.portal-forgot-password-link {
  text-align: center;
  margin-top: 16px;
}

.portal-forgot-password-link a {
  color: rgba(51, 135, 65, 1);
  text-decoration: none;
  transition: color 0.2s ease;
}

.portal-forgot-password-link a:hover {
  color: rgba(42, 115, 55, 1);
  text-decoration: underline;
}

/* Password Reset Progress Indicator */
.portal-reset-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 20px;
}

.portal-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  position: relative;
}

.portal-progress-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(220, 220, 220, 1);
  color: rgba(97, 97, 97, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Sans";
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.portal-progress-step.active .portal-progress-number {
  background-color: rgba(51, 135, 65, 1);
  color: rgba(255, 255, 255, 1);
}

.portal-progress-step.completed .portal-progress-number {
  background-color: rgba(51, 135, 65, 1);
  color: rgba(255, 255, 255, 1);
}

.portal-progress-step span {
  color: rgba(97, 97, 97, 1);
  transition: color 0.3s ease;
  text-align: center;
  width: 100%;
  display: block;
}

.portal-progress-step.active span {
  color: rgba(51, 135, 65, 1);
  font-weight: 600;
}

.portal-progress-line {
  flex: 1;
  height: 2px;
  background-color: rgba(220, 220, 220, 1);
  margin: 0 8px;
  margin-top: -20px;
  transition: background-color 0.3s ease;
}

.portal-progress-step.completed + .portal-progress-line {
  background-color: rgba(51, 135, 65, 1);
}

/* Password Reset Steps */
.portal-reset-step {
  display: none;
}

.portal-reset-step.active {
  display: block;
}

/* Responsive Progress Indicator */
@media (max-width: 767px) {
  .portal-reset-progress {
    padding: 0 10px;
  }
  
  .portal-progress-step span {
    font-size: 12px;
  }
  
  .portal-progress-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 479px) {
  .portal-reset-progress {
    padding: 0;
  }
  
  .portal-progress-step span {
    display: none;
  }
  
  .portal-progress-line {
    margin: 0 4px;
  }
}

/* Calendar Component */
.portal-calendar {
  margin-top: 24px;
  width: 100%;
}

.portal-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0;
  gap: 16px;
}

.portal-calendar-header h3 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: rgba(5, 5, 5, 1);
}

.portal-calendar-nav {
  background: transparent;
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 6px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(5, 5, 5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
}

.portal-calendar-nav:hover {
  background-color: rgba(243, 244, 246, 1);
  border-color: rgba(51, 135, 65, 1);
  color: rgba(51, 135, 65, 1);
}

.portal-calendar-nav:active {
  transform: scale(0.98);
}

.portal-calendar-nav span {
  font-family: "DM Sans";
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
}

.portal-calendar-grid {
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0px 3.84px 8px 0px rgba(177, 177, 177, 0.1);
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.portal-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: rgba(243, 244, 246, 1);
  border-bottom: 1px solid rgba(220, 220, 220, 1);
  width: 100%;
}

.portal-calendar-weekday {
  padding: 16px 8px;
  text-align: center;
  font-family: "DM Sans";
  font-weight: 600;
  font-size: 14px;
  line-height: 155%;
  letter-spacing: -0.02em;
  color: rgba(97, 97, 97, 1);
  border-right: 1px solid rgba(220, 220, 220, 1);
  box-sizing: border-box;
  width: 100%;
}

.portal-calendar-weekday:last-child {
  border-right: none;
}

.portal-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
}

.portal-calendar-day {
  min-height: 120px;
  padding: 12px 8px;
  border-right: 1px solid rgba(220, 220, 220, 1);
  border-bottom: 1px solid rgba(220, 220, 220, 1);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background-color: rgba(255, 255, 255, 1);
  box-sizing: border-box;
  width: 100%;
}

.portal-calendar-day:nth-child(7n) {
  border-right: none;
}

.portal-calendar-day:hover {
  background-color: rgba(243, 244, 246, 1);
}

.portal-calendar-day-other {
  color: rgba(180, 180, 180, 1);
  background-color: rgba(250, 250, 250, 1);
}

.portal-calendar-day-other:hover {
  background-color: rgba(243, 244, 246, 1);
}

.portal-calendar-day-today {
  background-color: rgba(240, 248, 255, 1);
  border: 2px solid rgba(51, 135, 65, 1);
  border-radius: 0;
}

.portal-calendar-day-today:hover {
  background-color: rgba(230, 245, 255, 1);
}

.portal-calendar-day-has-jobs {
  background-color: rgba(240, 255, 240, 1);
}

.portal-calendar-day-has-jobs:hover {
  background-color: rgba(220, 255, 220, 1);
  border-color: rgba(51, 135, 65, 1);
}

.portal-calendar-day-has-jobs.portal-calendar-day-today {
  background-color: rgba(230, 255, 240, 1);
}

.portal-calendar-day-number {
  font-family: "DM Sans";
  font-weight: 600;
  font-size: 16px;
  line-height: 155%;
  letter-spacing: -0.02em;
  color: rgba(5, 5, 5, 1);
  margin-bottom: 8px;
}

.portal-calendar-day-other .portal-calendar-day-number {
  color: rgba(180, 180, 180, 1);
}

.portal-calendar-day-badge {
  background-color: rgba(51, 135, 65, 1);
  color: rgba(255, 255, 255, 1);
  padding: 4px 12px;
  border-radius: 12px;
  font-family: "DM Sans";
  font-size: 12px;
  font-weight: 600;
  line-height: 155%;
  letter-spacing: -0.02em;
  margin-top: auto;
  width: fit-content;
  transition: background-color 0.2s ease;
}

.portal-calendar-day:hover .portal-calendar-day-badge {
  background-color: rgba(42, 115, 55, 1);
}

.portal-calendar-day-other .portal-calendar-day-badge {
  background-color: rgba(180, 180, 180, 1);
}

/* Desktop Responsive Calendar */
@media (min-width: 1200px) {
  .portal-calendar {
    width: 100%;
    max-width: 100%;
  }
  
  .portal-calendar-day {
    min-height: 140px;
    padding: 16px 12px;
  }
  
  .portal-calendar-day-number {
    font-size: 18px;
  }
  
  .portal-calendar-day-badge {
    font-size: 14px;
    padding: 6px 14px;
  }
  
  .portal-calendar-weekday {
    padding: 20px 12px;
    font-size: 16px;
  }
  
  .portal-calendar-header h3 {
    font-size: 48px;
  }
}

@media (min-width: 1400px) {
  .portal-calendar {
    width: 100%;
    max-width: 100%;
  }
  
  .portal-calendar-day {
    min-height: 160px;
    padding: 20px 16px;
  }
  
  .portal-calendar-day-number {
    font-size: 20px;
  }
  
  .portal-calendar-day-badge {
    font-size: 16px;
    padding: 8px 16px;
  }
  
  .portal-calendar-weekday {
    padding: 24px 16px;
    font-size: 18px;
  }
}

/* Tablet Responsive Calendar */
@media (max-width: 1023px) and (min-width: 769px) {
  .portal-calendar-day {
    min-height: 100px;
    padding: 10px 6px;
  }
  
  .portal-calendar-day-number {
    font-size: 15px;
  }
  
  .portal-calendar-day-badge {
    font-size: 11px;
    padding: 3px 10px;
  }
  
  .portal-calendar-weekday {
    padding: 14px 6px;
    font-size: 13px;
  }
  
  .portal-calendar-header h3 {
    font-size: 36px;
  }
}

/* Mobile Responsive Calendar */
@media (max-width: 768px) {
  .portal-calendar-day {
    min-height: 70px;
    padding: 6px 4px;
  }
  
  .portal-calendar-day-number {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .portal-calendar-day-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
  }
  
  .portal-calendar-weekday {
    padding: 12px 4px;
    font-size: 12px;
  }
  
  .portal-calendar-header {
    margin-bottom: 16px;
    gap: 12px;
  }
  
  .portal-calendar-header h3 {
    font-size: 32px;
  }
  
  .portal-calendar-nav {
    padding: 10px 16px;
    min-width: 44px;
    height: 44px;
  }
  
  .portal-calendar-nav span {
    font-size: 18px;
  }
}

@media (max-width: 479px) {
  .portal-calendar-day {
    min-height: 60px;
    padding: 4px 2px;
  }
  
  .portal-calendar-day-number {
    font-size: 12px;
    margin-bottom: 2px;
  }
  
  .portal-calendar-day-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  
  .portal-calendar-weekday {
    padding: 10px 2px;
    font-size: 11px;
  }
  
  .portal-calendar-header h3 {
    font-size: 28px;
  }
  
  .portal-calendar-nav {
    padding: 8px 12px;
    min-width: 40px;
    height: 40px;
  }
  
  .portal-calendar-nav span {
    font-size: 16px;
  }
}

/* Project Manager Styles */
.portal-project-manager {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

.portal-project-manager-sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
}

.portal-project-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.portal-project-manager-header h3 {
  margin: 0;
}

.portal-projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-project-item {
  padding: 12px 16px;
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 1);
}

.portal-project-item:hover {
  background-color: rgba(243, 244, 246, 1);
  border-color: rgba(51, 135, 65, 1);
}

.portal-project-item.active {
  background-color: rgba(240, 255, 240, 1);
  border-color: rgba(51, 135, 65, 1);
}

.portal-project-item-name {
  color: rgba(5, 5, 5, 1);
  margin-bottom: 4px;
}

.portal-project-item-meta {
  color: rgba(97, 97, 97, 1);
}

.portal-project-manager-content {
  flex: 1;
  min-width: 0;
}

.portal-project-editor {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 24px;
}

.portal-project-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(220, 220, 220, 1);
}

.portal-project-editor-header h3 {
  margin: 0;
}

.portal-project-images-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(220, 220, 220, 1);
}

.portal-project-images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.portal-project-images-header h4 {
  margin: 0;
}

.portal-project-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
  position: relative;
}

/* Upload Loading Overlay */
.portal-upload-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 8px;
}

.portal-upload-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.portal-upload-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(51, 135, 65, 0.2);
  border-top-color: rgba(51, 135, 65, 1);
  border-radius: 50%;
  animation: portal-spin 1s linear infinite;
}

@keyframes portal-spin {
  to {
    transform: rotate(360deg);
  }
}

.portal-upload-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.portal-project-image-item {
  position: relative;
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 1);
  cursor: move;
  transition: all 0.2s ease;
}

.portal-project-image-item:hover {
  border-color: rgba(51, 135, 65, 1);
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}

.portal-project-image-item.dragging {
  opacity: 0.5;
  border-color: rgba(51, 135, 65, 1);
}

.portal-project-image-preview {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  background-color: rgba(243, 244, 246, 1);
  overflow: hidden;
}

.portal-project-image-preview img,
.portal-project-image-preview video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-project-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portal-project-image-item:hover .portal-project-image-overlay {
  opacity: 1;
}

.portal-image-delete-btn {
  padding: 8px 12px;
  min-width: auto;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-image-delete-btn span {
  font-size: 20px;
  line-height: 1;
}

.portal-project-image-name {
  padding: 8px 12px;
  color: rgba(97, 97, 97, 1);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Responsive Project Manager */
@media (max-width: 1023px) {
  .portal-project-manager {
    flex-direction: column;
  }
  
  .portal-project-manager-sidebar {
    width: 100%;
  }
  
  .portal-project-images-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .portal-project-images-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .portal-project-editor {
    padding: 16px;
  }
  
  .portal-project-manager-sidebar {
    padding: 16px;
  }
}

/* Project Backup Section */
.portal-project-backup-section {
  background-color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(220, 220, 220, 1);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.portal-project-backup-header {
  margin-bottom: 16px;
}

.portal-project-backup-header h3 {
  margin: 0;
}

.portal-project-backup-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-import-progress {
  margin-top: 16px;
  padding: 12px;
  background-color: rgba(243, 244, 246, 1);
  border-radius: 8px;
}

.portal-import-progress-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(220, 220, 220, 1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.portal-import-progress-fill {
  height: 100%;
  background-color: rgba(51, 135, 65, 1);
  width: 0%;
  transition: width 0.3s ease;
}

.portal-import-progress span {
  display: block;
  text-align: center;
  color: rgba(97, 97, 97, 1);
}

/* Loading State */
.portal-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}

.portal-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(220, 220, 220, 1);
  border-top-color: rgba(51, 135, 65, 1);
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}

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