/* Minimal base styles for the portfolio engine 
====================================================================*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.page-container {
  padding-top: var(--header-height); /* Use the header height variable or fallback to 60px */
  min-height: calc(100vh - var(--header-height)); /* Ensure minimum page height */
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.section {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* unneeded: we will reuse loading indicator
===========================================================================================
*/
.section.loading:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  z-index: 1;
}

.section.loading:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;

}

/* Global styles for the loading indicator
==========================================================================================
*/
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100hh;
  background-color: #000000;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: opacity 0.5s ease;
  min-width: 20%;
}

.loading-content {
  text-align: center;
  width: 100%;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-left-color: #09f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-bottom: 15px;
  font-size: 16px;
}

.loading-progress {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 15px;
}

.progress-fill {
  height: 100%;
  width: 5%;
  background-color: #09f;
  transition: width 0.3s ease;
}

.loading-error {
  color: #ff6b6b;
  padding: 10px;
  margin-top: 15px;
  background-color: rgba(255, 107, 107, 0.1);
  border-radius: 4px;
  font-size: 14px;
}

.loading-retry {
  margin-top: 10px;
  padding: 6px 15px;
  background-color: #09f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.loading-retry:hover {
  background-color: #007acc;
}

/* Custom loading overlay 
==========================================================================================
*/
/*
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.error-container {
  padding: 1rem;
  margin: 1rem 0;
  background-color: rgba(255, 0, 0, 0.1);
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
}

.error-message {
  color: var(--accent-color);
  font-weight: bold;
}


.error-container.global {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  max-width: 400px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.error-message {
  padding: 1rem;
  background-color: rgba(255, 0, 0, 0.1);
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
  color: var(--accent-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.error-message.fatal {
  background-color: rgba(255, 0, 0, 0.2);
  border-color: darkred;
}

.error-message h3 {
  margin-top: 0;
  color: var(--accent-color);
}

.error-message button.dismiss-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 0.5rem;
}

.error-message pre {
  white-space: pre-wrap;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  border-radius: 3px;
  max-height: 200px;
  overflow: auto;
}
*/
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 1rem;
  }
}
