@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100dvh;
}
body {
    font-family: 'Architects Daughter', cursive;
    background-color: #cfefff;
    position: relative;
}
#main {
    width: 100%;
    height: 85%;
    padding: 2rem;
    display: flex;
    justify-content: center;
}
#nav {
  position: sticky;
  top: 0px;
  background-color: #333;
  z-index: 1000;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
}

.nav-logo img {
  height: 60px; /* Adjust to your preference */
  width: auto;
  border-radius: 0.25em
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-spacer {
  width: 60px; /* Should match the logo width to keep items centered */
  padding: 0.5rem 1rem;
}

#nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1; /* This allows the ul to take up available space */
}

#nav li {
  margin: 0.5rem 1rem;
}

#nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  display: block;
}

#nav ul li a:hover {
  background-color: #575757;
  border-radius: 4px;
}

/* Keep your existing nav li and nav a styles */

@media (max-width: 600px) {
  #nav {
    flex-direction: column;
  }
  
  .nav-logo {
    align-self: flex-start;
  }
  
  .nav-spacer {
    display: none;
  }

  #nav ul {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  #nav li {
    margin: 0.25rem 0;
  }

  #nav ul li a {
    text-align: left;
    font-size: 1.1rem;
  }
}
.learnels h3 {
    padding-top: 1%;
}

button {
    cursor: grab;
    /*background-color: TBD;*/
    width: 250px;
    height: 125px;
    font-family: inherit;
    font-size: 32px;
}
button:active{
    transform: scale(0.96);
}

#learn-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    align-self: center;
    align-items: center;
    justify-content: center;
}

#each-element {
    display: flex;
    border: black 4px solid;
    width: min(20vw, 20vh);
    aspect-ratio: 1 / 1;
    flex-direction: column;
    justify-content: space-around;
    position: absolute;
    top: calc(5rem + 3%);
    left: 3%;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    font-size: min(2vw, 2vh);
}

#search-bar {
    position: absolute;
    top: calc(5rem + 1%);
    right: 1%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
#search-bar:focus-within #suggestions {
    display: flex;
}
#search-inp {
    width: min(30vw, 30vh);
    padding: 0.5rem 1rem;
    font-size: 1.15rem;
    border: 2px solid #ccc;
    border-radius: 10px;
    outline: none;
}
#suggestions {
    position: absolute;
    margin-top: 2.65rem;
    list-style: none;
    display: none;
    flex-direction: column;
    justify-content: space-between;
}
#suggestions li {
    cursor: grab;
    width: min(30vw, 30vh);
    padding: 0.5rem 1rem;
    font-size: 1.15rem;
    border: 2px solid #ccc;
    border-radius: 10px;
    outline: none;
    background-color: white;
}

#num {
    position: relative;
    left: 10%;
    top: 5%;
    font-size: 1.5em;
}
#symbol, #el-name {
    align-self: center;
}
#symbol {
    font-size: 3em;
    margin-bottom: 7%;
}
#el-name {
    position: relative;
    bottom: 5%;
    font-size: 1.3em;
}

#intro {
    margin: 2.5rem 0;
    font-size: 2.5rem;
    font-weight: bold;
}

#content {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    align-self: center;
    align-items: center;
}
#prevdiv, #nextdiv {
    flex: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
#prevbtn, #nextbtn {
    border: unset;
    width: 100%;
    height: unset;
    background-color: transparent;
    transition: all 0.2s ease;
}

#prevbtn {
    display: none;
}

#prevbtn:hover, #nextbtn:hover {
    transform: scale(1.08)
}
#prevbtn div, #nextbtn div {
    display: flex;
    align-items: center;
    justify-content: center;
}
#previmg, #nextimg {
    width: 70%;
    height: auto;
    display: block;
}

#ffbox {
    flex: 14;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-height: 500px;
    gap: 2rem;
    margin-bottom: 2rem;
}
.learnels{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: grab;
    transition: all 0.2s ease;
}
.learnels:hover {
    transform: scale(1.05)
}
.learnels h3 {
    text-align: center;
    font-weight: bolder;
    font-size: 2rem;
}
#config {
    background-color: #f6d9d6;
}
#ffs {
    background-color: #ffc107;
}
#ions {
    background-color: #85e3f6;
}
#basicscrn {
    background-color: #d6e4ec;
}
#apps {
    background-color: #d8efd1;
}
#sources {
    background-color: #e5daf6;
}

/* Popups */
.modal {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    z-index: 999;
}

@keyframes detect-scroll {
    from, to {--can-scroll: 2;}
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: clamp(300px, 80vw, 900px);
    height: clamp(300px, 80vh, 800px);
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
    scrollbar-gutter: stable overlay;
    --can-scroll: 1;
    animation: detect-scroll linear;
    animation-timeline: scroll(self);
}

.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 12px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px; /* calc(12px * var(--can-scroll)); */
    z-index: 1010;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: #374151;
}

.close-btn:hover {
    background: #e5e7eb;
}

.section-header h1 {
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2563eb;
}

.section-header p {
    text-align: center;
    color: #374151;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Modal animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Basic Facts section styles */
.properties-section {
    padding: 4rem 0;
    background: white;
}

#properties-title {
    margin-top: -2rem;
    margin-bottom: 3rem;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.property-card {
    grid-column: span 2;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    transform-origin: center;
}

.property-card:nth-child(1) {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.property-card:nth-child(2) {
    background: linear-gradient(135deg, #f0f9ff 0%, #bfdbfe 100%);
}

.property-card:nth-child(3) {
    background: linear-gradient(135deg, #f0fdf4 0%, #bbf7d0 100%);
}

.property-card:nth-child(4) {
    background: linear-gradient(135deg, #fefce8 0%, #fde047 100%);
}

.property-card:nth-child(5) {
    background: linear-gradient(135deg, #fdf4ff 0%, #e879f9 100%);
    grid-column: 2 / span 2;
}

.property-card:nth-child(odd) {
    transform: rotate(-1deg);
}

.property-card:nth-child(even) {
    transform: rotate(1deg);
}

.property-card:hover {
    transform: rotate(0deg) scale(1.02) translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

@media (max-width: 920px) {
  .property-card {
    grid-column: span 1;
  }

  .property-card:nth-child(5) {
    grid-column: span 1;
  }

  .properties-grid {
    grid-template-columns: 1fr;
  }
}

.property-icon {
    font-size: 3rem;
    margin: 0 auto 1rem;
    color: #2563eb;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-card h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.5rem;
}

.property-card .value {
    font-size: 1.875rem;
    font-weight: bold;
    color: #2563eb;
}

.property-card .unit {
    color: #6b7280;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Fun facts section styles */
.fun-facts-section {
    padding: 2rem 0;
    background: white;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 64rem;
    margin: 0 auto;
}

.fact-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    border: 1px solid #60a5fa;
    transform: rotate(-2deg);
    transition: all 0.3s ease;
}

.fact-card:nth-child(even) {
    transform: rotate(2deg);
}

.fact-card:hover {
    transform: rotate(0deg) scale(1.05);
}

.fact-titles {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.75rem;
}

.fact-info {
    color: #374151;
    font-size: 1rem;
    line-height: 1.5;
}

/*Electron Config section styles*/
.electron-section {
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.electron-section h1 {
    margin-bottom: 0.5rem;
}

#config-info {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 0.5rem;
    text-align: center;
}

#full {
    width: 45%;
    height: 35%;
    border-radius: 12px;
    border: 1px solid #60a5fa;
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    font-size: 1rem;
    margin-bottom: 3rem;
}

.info-card {
    background: lightblue;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.info-card h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.75rem;
}

.info-card p {
    color: #6b7280;
}

.orbital-container {
    display: flex;
    justify-content: center;
}

.orbital-diagram {
    position: relative;
}

.nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6rem;
    height: 6rem;
    background: #ea580c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
    z-index: 999;
}

.nucleus:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.orbital {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 4px solid #3b82f6;
    opacity: 0.3;
}

/* The electron itself */
.electron {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* The animation now lives here */
    animation: orbit 4s linear infinite;
}

/* The animation keyframes */
@keyframes orbit {
    from {
    /* The animation now starts from the unique angle. */
    transform: var(--initial-transform);
    }
    to {
    /* And ends 360 degrees from that unique angle. */
    transform: var(--final-transform);
    }
}

.orbital-labels {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1010;
}

.orbital-label {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Compounds section styles */
.compounds-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    border-radius: 12px;
}

.compounds-section .section-header {
    margin-bottom: 3rem;
}

.noble {
    display: none;
    text-align: center;
    font-size: 1.25rem;
    color: #374151;
    margin-bottom: 2rem;
}

.compounds-list > * + * {
    margin-top: 2rem;
}

.compound-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.compound-item:nth-child(even) {
    flex-direction: row-reverse;
}

.compound-card {
    flex: 1;
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
    border: 1px solid #60a5fa;
    transition: all 0.3s ease;
    flex-grow: 6;
}

.compound-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.compound-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.5rem;
}

.compound-formula {
    font-size: 1.875rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.compound-description {
    color: #374151;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.compound-uses {
    background: #f0f9ff;
    border-radius: 0.5rem;
    padding: 1rem;
}

.compound-uses h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.compound-uses p {
    color: #6b7280;
}

.icon-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compound-icon {
    flex-shrink: 0;
    width: 8rem;
    height: 8rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.compound-icon:hover {
    transform: scale(1.1) rotate(360deg);
}

@media (max-width: 768px) {
    .compound-item, .compound-item:nth-child(even) {
        flex-direction: column;
    }
}

/* Sources section styles */
.sources-section {
    padding: 2rem 0;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.source-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
    border: 1px solid #60a5fa;
    transition: all 0.3s ease;
    height: 100%;
}

.source-card:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.2);
}

.source-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.source-icon {
    font-size: 3rem;
    margin-right: 1rem;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 50%;
}

.source-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #374151;
    margin: 0;
}

.source-location {
    color: #2563eb;
    font-size: 0.875rem;
    margin: 0;
}

.source-description {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.source-details > * + * {
    margin-top: 1rem;
}

.source-detail {
    background: #f0f9ff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.source-detail h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.source-detail p {
    color: #6b7280;
    margin: 0;
}

.abundance {
    color: #2563eb !important;
    font-weight: bold !important;
    font-size: 1.125rem !important;
}

/* Application section styles */
.applications-section {
    padding: 2rem 0;
    background: white;
}

.applications-section .section-header {
    margin-bottom: 3rem;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.application-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    border: 1px solid #60a5fa;
    transition: all 0.3s ease;
    height: 100%;
}

.application-card:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.2);
}

.application-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.application-icon {
    font-size: 2.5rem;
    margin-right: 3rem;
}

.application-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #374151;
}

.application-description {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.application-details {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #60a5fa;
}

.application-details h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.application-details p {
    color: #6b7280;
}