/* === VARIABLES (Theme Colors & Layout) === */
:root {
    --bg-light: #f0f4f8;
    --bg-dark: #1a1a1a;
    --text-light: #ffffff;
    --text-dark: #333333;
    --accent: #0066cc;
    --accent-hover: #0073e6;
    --card-bg-light: #ffffff;
    --card-bg-dark: #2a2a2a;
    --header-bg: linear-gradient(90deg, #004080, #0066cc);
    --header-dark-bg: linear-gradient(90deg, #001f3f, #003366);
}

/* === GLOBAL STYLES === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    align-items: center;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
header {
    background: var(--header-bg);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    transition: background 0.3s;
    width: 100%;
}

body.dark-mode header {
    background: var(--header-dark-bg);
}

header h1 {
    margin: 0;
    font-size: 3rem;
    letter-spacing: 1px;
}

header .slogan {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-style: italic;
    color: #d0eaff;
}

/* === NAVIGATION === */
nav ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    color: #ffffff;
    background-color: var(--accent);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: scale(1);
}

nav a:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

/* === MAIN CONTENT === */
main {
    padding: 2rem 1rem;
    width: 100%;
    max-width: 960px;
    flex: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* === SECTION CARDS (z. B. Tools, News, etc.) === */
section {
    width: 100%;
    max-width: 960px;
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background: var(--card-bg-light);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: transform 0.2s, background-color 0.3s;
    text-align: center;
}

body.dark-mode section {
    background: var(--card-bg-dark);
}

section:hover {
    transform: scale(1.01);
}

section h2 {
    color: #004080;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* === PERIODIC TABLE LEGEND === */
#periodic-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    padding: 1rem;
}

.legend-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid #999;
}

/* === COLLAPSIBLE SECTIONS === */
.collapsible {
    cursor: pointer;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #e8f0ff;
    border-radius: 8px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

.collapsible:hover {
    background-color: #d0e5ff;
}

.arrow {
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.collapsible.open .arrow {
    transform: rotate(90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s;
    padding: 0 0;
}

.collapsible-content.open {
    max-height: 2000px;
    padding: 1rem 0;
}

/* === NEWS CARDS === */
.card-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    align-items: center;
}

.news-card {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    background-color: #f9f9f9;
    width: 100%;
    max-width: 700px;
}

.news-card h3 {
    margin: 0 0 10px 0;
}

.news-card a {
    text-decoration: none;
    color: #0074d9;
}

.news-card a:hover {
    text-decoration: underline;
}

.news-card small {
  display: block;
  margin-top: 15px;
  padding: 10px;
  background-color: #e8f0ff;
  border-top: 1px solid #c0d8f0;
  border-radius: 0 0 8px 8px;
  font-size: 0.85em;
  color: #333;
}

.news-card strong {
    color: #0074d9;
}

/* === KEKULE EXPORT BUTTONS === */
.kekule-export-buttons {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.kekule-export-buttons button {
  padding: 0.5rem 1.2rem;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.kekule-export-buttons button:hover {
  background-color: var(--accent-hover);
}

/* === FOOTER === */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: #00264d;
    color: #ffffff;
    font-size: 0.9rem;
    box-shadow: 0 -4px 8px rgba(0,0,0,0.05);
    margin-top: auto;
    width: 100%;
}

/* === RESPONSIVE DESIGN === */
@media screen and (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        padding: 0.6rem;
        font-size: 1rem;
    }

    section {
        padding: 1rem;
    }
}

.book-section {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.book-section h3 {
  margin-top: 0;
  color: #004080;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.4rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.book-card {
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.book-card a {
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.book-card a:hover {
  text-decoration: underline;
}

.book-card p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #444;
}
