/**
 * Office Time Widget - Standalone CSS
 * Version: 2.0.0
 */

/* Import Cal Sans font - försöker lokal först, sedan CDN som fallback */
@font-face {
  font-family: 'Cal Sans';
  src: url('../fonts/CalSans-Regular.ttf') format('truetype'),
       url('fonts/CalSans-SemiBold.woff2') format('woff2'),
       url('fonts/CalSans-SemiBold.woff') format('woff'),
       url('https://cdn.cal.com/CalSans-SemiBold.woff2') format('woff2'),
       url('https://cdn.cal.com/CalSans-SemiBold.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cal Sans';
  src: url('fonts/CalSans-SemiBold.woff2') format('woff2'),
       url('fonts/CalSans-SemiBold.woff') format('woff'),
       url('https://cdn.cal.com/CalSans-SemiBold.woff2') format('woff2'),
       url('https://cdn.cal.com/CalSans-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

.otw-container {
  position: relative;
  display: inline-block;
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.otw-trigger {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 18px;
  color: #1E1C1B;
  cursor: pointer;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 400;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.otw-time-display {
  font-family: 'Cal Sans', 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.otw-trigger:hover {
  opacity: 0.8;
}

.otw-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 0;
  width: 320px;
  z-index: 1000;
  animation: otw-slideIn 0.2s ease-out;
  overflow: hidden;
}

@keyframes otw-slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Popup header with close button */
.otw-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px 12px 0 12px;
}

.otw-close-button {
  background: transparent;
  border: none;
  font-size: 15px;
  color: #666;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.otw-close-button:hover {
  color: #1E1C1B;
}

.otw-divider {
  height: 1px;
  background: #E5E5E5;
  margin: 0 20px;
}

/* Popup content */
.otw-popup-content {
  padding: 8px 20px 16px 20px;
}

.otw-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.otw-popup-status-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.otw-popup-status-icon.open {
  background: #00D66C;
}

.otw-popup-status-icon.closed {
  background: #FF4444;
}

.otw-popup-title {
  font-family: 'Cal Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: #1E1C1B;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.otw-popup-subtitle {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  color: #666;
  margin: 0 0 8px 0;
  line-height: 1.4;
  font-weight: 400;
}

.otw-status-indicator {
  width: 12px;
  height: 12px;
  background: #00D66C;
  border-radius: 50%;
  flex-shrink: 0;
}

.otw-status-indicator.closed {
  background: #FF4444;
}

/* Info rows */
.otw-info-rows {
  padding: 16px 20px;
}

.otw-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.otw-info-row:not(:last-child) {
  border-bottom: none;
}

.otw-info-row-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  color: #666;
  font-weight: 400;
}

.otw-info-row-value {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  color: #1E1C1B;
  font-weight: 600;
}

/* Responsive adjustments */

/* Tablets (iPad portrait and smaller) */
@media (max-width: 768px) {
  .otw-popup {
    width: 90vw;
    max-width: 320px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .otw-trigger {
    font-size: 16px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .otw-popup {
    width: calc(100vw - 32px);
    max-width: 300px;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
  }
  
  .otw-popup-title {
    font-size: 20px;
  }
  
  .otw-popup-subtitle {
    font-size: 13px;
  }
  
  .otw-trigger {
    font-size: 16px;
  }
  
  .otw-time-display {
    font-size: 16px;
  }
  
  .otw-popup-content {
    padding: 8px 16px 12px 16px;
  }
  
  .otw-info-rows {
    padding: 12px 16px;
  }
  
  .otw-divider {
    margin: 0 16px;
  }
  
  .otw-info-row-label,
  .otw-info-row-value {
    font-size: 13px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .otw-popup {
    width: calc(100vw - 24px);
  }
  
  .otw-popup-title {
    font-size: 18px;
  }
  
  .otw-trigger {
    font-size: 15px;
  }
}
