/* table layout */
main { 
  padding: 1rem 0 3rem 0; 
}

/* site header */
.site-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 0.6rem 2rem; 
  background: rgba(21, 21, 34, 0.8); 
  backdrop-filter: blur(10px); 
  position: sticky; 
  top: 0; 
  z-index: 1000; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.5); 
  transition: background 0.3s ease;
}

/* light theme */
body.light-theme .site-header { 
  background: rgba(255, 255, 255, 0.95); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
}

/* logo image */
.logo-image {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--color-accent);
  transition: all 0.3s ease;
}

/* main nav */
.main-nav { 
  display: flex; 
  gap: 1rem; 
  align-items: center;
}

.main-nav a { 
  font-size: 0.85rem; 
  color: var(--color-text); 
  text-decoration: none; 
  transition: all 0.2s ease; 
  padding: 0.35rem 0.9rem; 
  border-radius: 30px; 
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

body.light-theme .main-nav a {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
}

.main-nav a:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

/* theme switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

/* search container */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  width: 100%;
}

/* poda */
#poda {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* input */
.input {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #e0e0e0;
  border: none;
  width: 320px;
  height: 52px;
  border-radius: 12px;
  padding-inline: 50px;
  font-size: 15px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  font-family: var(--font-family);
}

body.light-theme .input {
  background: linear-gradient(135deg, #ffffff, #f0f2f5);
  color: #1a1a2e;
  border: 1px solid #ddd;
}

.input:focus {
  outline: none;
  background: linear-gradient(135deg, #1e1e35, #1a1a30);
  color: #ffffff;
}

body.light-theme .input:focus {
  background: linear-gradient(135deg, #ffffff, #e8edf5);
  color: #1a1a2e;
  border-color: #0066cc;
}

.input::placeholder {
  color: #8888aa;
}

body.light-theme .input::placeholder {
  color: #999;
}

/* glow */
.glow, .border, .darkBorderBg, .white {
  max-height: 66px;
  max-width: 340px;
  height: 100%;
  width: 100%;
  position: absolute;
  overflow: hidden;
  z-index: 0;
  border-radius: 14px;
  filter: blur(3px);
}

/* white */
.white {
  max-height: 59px;
  max-width: 333px;
  border-radius: 12px;
  filter: blur(2px);
}

.white::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(83deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.4);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0) 0%,
    #fff,
    rgba(0, 0, 0, 0) 8%,
    rgba(0, 0, 0, 0) 50%,
    #aaa,
    rgba(0, 0, 0, 0) 58%
  );
  transition: all 2s;
}

body.light-theme .white::before {
  background-image: conic-gradient(
    rgba(0, 0, 0, 0) 0%,
    #0066cc,
    rgba(0, 0, 0, 0) 8%,
    rgba(0, 0, 0, 0) 50%,
    #0099ff,
    rgba(0, 0, 0, 0) 58%
  );
  filter: brightness(1.6);
}

/* border */
.border {
  max-height: 55px;
  max-width: 329px;
  border-radius: 13px;
  filter: blur(0.5px);
}

.border::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(70deg);
  position: absolute;
  width: 600px;
  height: 600px;
  filter: brightness(1.3);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #fff,
    #aaa 5%,
    #fff 14%,
    #fff 50%,
    #aaa 60%,
    #fff 64%
  );
  transition: all 2s;
}

body.light-theme .border::before {
  background-image: conic-gradient(
    #0066cc,
    #0099ff 5%,
    #0066cc 14%,
    #0066cc 50%,
    #0099ff 60%,
    #0066cc 64%
  );
  filter: brightness(1.5);
}

/* darkBorderBg */
.darkBorderBg {
  max-height: 61px;
  max-width: 336px;
}

.darkBorderBg::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(82deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #fff,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0) 50%,
    #aaa,
    rgba(0, 0, 0, 0) 60%
  );
  transition: all 2s;
}

body.light-theme .darkBorderBg::before {
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #0088cc,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0) 50%,
    #0066cc,
    rgba(0, 0, 0, 0) 60%
  );
  filter: brightness(1.5);
}

/* glow */
.glow {
  overflow: hidden;
  filter: blur(30px);
  opacity: 0.5;
  max-height: 130px;
  max-width: 370px;
}

.glow::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(60deg);
  position: absolute;
  width: 999px;
  height: 999px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #000,
    #fff 5%,
    #000 38%,
    #000 50%,
    #aaa 60%,
    #000 87%
  );
  transition: all 2s;
}

body.light-theme .glow::before {
  background-image: conic-gradient(
    #fff,
    #0066cc 5%,
    #fff 38%,
    #fff 50%,
    #0099ff 60%,
    #fff 87%
  );
  opacity: 0.8;
}

#poda:hover > .darkBorderBg::before,
/* poda */
#poda:focus-within > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(262deg);
  transition: all 4s;
}

#poda:hover > .glow::before,
#poda:focus-within > .glow::before {
  transform: translate(-50%, -50%) rotate(240deg);
  transition: all 4s;
}

#poda:hover > .white::before,
#poda:focus-within > .white::before {
  transform: translate(-50%, -50%) rotate(263deg);
  transition: all 4s;
}

#poda:hover > .border::before,
#poda:focus-within > .border::before {
  transform: translate(-50%, -50%) rotate(250deg);
  transition: all 4s;
}

/* search icon */
#search-icon {
  position: absolute;
  left: 16px;
  top: 14px;
  color: var(--color-accent);
  z-index: 3;
  cursor: pointer;
}

/* search results */
.search-results {
  margin-top: 15px;
  max-width: 340px;
  width: 100%;
  background: rgba(30, 30, 47, 0.95);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: none;
  max-height: 350px;
  overflow-y: auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

body.light-theme .search-results {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-results.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* result item */
.result-item {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.light-theme .result-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light-theme .result-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* result symbol */
.result-symbol {
  font-weight: bold;
  color: var(--color-accent);
  font-size: 1rem;
}

/* result name */
.result-name {
  color: var(--color-text);
  font-size: 0.85rem;
}

/* table container */
.table-container { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 1rem; 
  padding: 0 1rem; 
}

/* periodic table */
.periodic-table { 
  display: grid; 
  direction: ltr; 
  grid-template-columns: repeat(18, minmax(0, 1fr)); 
  grid-template-rows: repeat(8, minmax(0, 1fr)); 
  gap: 6px; 
  width: 100%; 
  max-width: 1400px; 
}

/* series container */
.series-container { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  width: calc(15/18 * 100%); 
  max-width: 1160px; 
}

/* element row */
.element-row {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  direction: ltr;
}

/* detail panel */
.detail-panel {
  position: fixed; 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(21, 21, 34, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2rem; 
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  width: 90%; 
  max-width: 550px; 
  max-height: 85vh;
  overflow-y: auto; 
  z-index: 2000;
  opacity: 0; 
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s;
}

body.light-theme .detail-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.detail-panel:not(.hidden) { 
  opacity: 1; 
  visibility: visible; 
  transform: translate(-50%, -50%) scale(1); 
}

.detail-panel #closeDetail { 
  position: absolute; 
  top: 1rem; 
  left: 1rem; 
  background: var(--color-accent-2); 
  color: white; 
  border: none; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 1.3rem; 
  transition: all 0.2s; 
  z-index: 2; 
}

.detail-panel #closeDetail:hover { 
  transform: scale(1.1) rotate(90deg); 
}

.detail-panel h2 { 
  font-size: 1.8rem; 
  color: var(--color-accent); 
  margin-bottom: 1.2rem;
  text-align: center;
}

.detail-panel p { 
  margin: 0.5rem 0; 
  color: #ccc; 
  line-height: 1.6; 
}

body.light-theme .detail-panel p {
  color: #555;
}

.detail-panel p strong { 
  color: #fff; 
  margin-left: 8px;
}

body.light-theme .detail-panel p strong { 
  color: #333; 
}

/* site footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
  background: var(--color-bg-light);
  transition: background 0.3s ease;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

body.light-theme .site-footer p {
  color: #555555;
}

/* mobile 768px */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 1rem;
  }
  
  .logo span {
    font-size: 1.1rem;
  }
  
  .logo-image {
    width: 30px;
    height: 30px;
  }
  
  .main-nav a {
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
  }

  .result-symbol { font-size: 0.9rem; }
  .result-name { font-size: 0.75rem; }
}

/* mobile 480px */
@media (max-width: 480px) {
}