/* ===================================================
   periodic-extras.css — Extracted inline styles
   Source: index.php (two inline <style> blocks)
   =================================================== */

/* --- Main Periodic Table Styles --- */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #2d3436;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.info-display {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.info-content {
    transition: opacity 0.25s ease;
}

.info-content.fade-out {
    opacity: 0;
}

.info-content.fade-in {
    opacity: 1;
}

.info-display h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 8px;
    line-height: 1.3;
}

.toxic-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.toxic-level.safe {
    background: #d4edda;
    color: #155724;
}

.toxic-level.low {
    background: #fff3cd;
    color: #856404;
}

.toxic-level.moderate {
    background: #ffe5d0;
    color: #a0522d;
}

.toxic-level.high {
    background: #f8d7da;
    color: #721c24;
}

.toxic-level.extreme {
    background: #6c757d;
    color: #fff;
}

.toxic-level.radioactive {
    background: #2d3436;
    color: #00ff00;
}

.info-display p {
    font-size: 1rem;
    color: #636e72;
    line-height: 1.5;
    max-width: 700px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #636e72;
    font-weight: 500;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.alkali-metal { background: #ffb3ba; box-shadow: 0 3px 10px rgba(255,179,186,0.4); }
.alkaline-earth { background: #ffdfba; box-shadow: 0 3px 10px rgba(255,223,186,0.4); }
.transition-metal { background: #ffffba; box-shadow: 0 3px 10px rgba(255,255,186,0.4); }
.post-transition { background: #baffc9; box-shadow: 0 3px 10px rgba(186,255,201,0.4); }
.metalloid { background: #bae1ff; box-shadow: 0 3px 10px rgba(186,225,255,0.4); }
.nonmetal { background: #eecbff; box-shadow: 0 3px 10px rgba(238,203,255,0.4); }
.halogen { background: #ffb3e6; box-shadow: 0 3px 10px rgba(255,179,230,0.4); }
.noble-gas { background: #c9bae8; box-shadow: 0 3px 10px rgba(201,186,232,0.4); }
.lanthanide { background: #bae0e8; box-shadow: 0 3px 10px rgba(186,224,232,0.4); }
.actinide { background: #d4bae8; box-shadow: 0 3px 10px rgba(212,186,232,0.4); }
.unknown { background: #e8e8e8; box-shadow: 0 3px 10px rgba(200,200,200,0.4); }

.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 8px;
    margin: 0 auto;
}

.element {
    position: relative;
    aspect-ratio: 2 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    min-height: 30px;
    padding: 4px 2px;
    border: none;
    color: #2d3436;
    font-weight: 600;
}

.element:hover {
    transform: translateY(-4px) scale(1.05);
    z-index: 100;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.element .number {
    font-size: 0.55rem;
    position: absolute;
    top: 2px;
    left: 4px;
    opacity: 0.7;
    color: inherit;
    font-weight: 500;
}

.element .symbol {
    font-size: 1.1rem;
    font-weight: 700;
}

.element .name-display {
    display: none;
}

.element:hover .name-display {
    display: block;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #2d3436;
    padding: 16px;
    border-radius: 12px;
    width: 220px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    animation: popupFade 0.25s ease;
}

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

.element:hover .name-display .full-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.element:hover .name-display .description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #636e72;
}

.element:hover .name-display .category {
    margin-top: 10px;
    font-size: 0.7rem;
    color: #b2bec3;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.empty {
    visibility: hidden;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #b2bec3;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .periodic-table { gap: 4px; }
    .element { min-width: 45px; min-height: 22px; }
    .element .symbol { font-size: 0.9rem; }
}

@media (max-width: 768px) {
    body { padding: 20px 10px; }
    .info-display { padding: 20px; height: 140px; }
    .info-display h1 { font-size: 1.4rem; }
    .info-display p { font-size: 0.9rem; }
    .legend { gap: 8px; font-size: 0.75rem; }
    .periodic-table { gap: 2px; }
    .element { min-width: 32px; min-height: 16px; border-radius: 6px; }
    .element .symbol { font-size: 0.7rem; }
    .element .number { font-size: 0.55rem; top: 2px; left: 3px; }
}

/* --- Theme Toggle & Bottom Sheet Styles --- */

.theme-toggle-periodic{
    position:fixed;bottom:100px;right:20px;z-index:2147483646;
    width:50px;height:50px;border-radius:50%;
    border:2px solid rgba(102,126,234,0.5);
    background:linear-gradient(135deg,rgba(102,126,234,0.8),rgba(118,75,162,0.8));
    cursor:pointer;display:flex;align-items:center;justify-content:center;
    font-size:24px;box-shadow:0 4px 20px rgba(102,126,234,0.6);
    transition:all 0.3s ease;
}
.theme-toggle-periodic:hover{transform:scale(1.1);box-shadow:0 6px 30px rgba(102,126,234,0.9);}
body.dark-periodic,body.dark,body.dark-mode{background:#0a0a0f !important;color:#f0f0f0 !important;}
body.dark-periodic .element,body.dark .element,body.dark-mode .element{background:#1a1a2e !important;border-color:#2a2a3e !important;}
body.dark-periodic .element .number,body.dark .element .number,body.dark-mode .element .number,
body.dark-periodic .element .symbol,body.dark .element .symbol,body.dark-mode .element .symbol{color:#f0f0f0 !important;}
body.dark-periodic .element .full-name,body.dark .element .full-name,body.dark-mode .element .full-name{color:#a0a0b0 !important;}
body.dark-periodic .info-display,body.dark .info-display,body.dark-mode .info-display{background:#1a1a2e !important;border-color:#2a2a3e !important;color:#f0f0f0 !important;}
body.dark-periodic .legend,body.dark .legend,body.dark-mode .legend{background:#12121a !important;}
body.dark-periodic .legend-item,body.dark .legend-item,body.dark-mode .legend-item{color:#c0c0d0 !important;}
body.dark-periodic .info-display p,body.dark .info-display p,body.dark-mode .info-display p{color:#b0b0c0 !important;}
body.dark-periodic .element:hover .name-display,body.dark .element:hover .name-display,body.dark-mode .element:hover .name-display{background:#1a1a2e !important;color:#f0f0f0 !important;border-color:#2a2a3e !important;}
body.dark-periodic .element:hover .name-display .description,body.dark .element:hover .name-display .description,body.dark-mode .element:hover .name-display .description{color:#b0b0c0 !important;}
body.dark-periodic .element:hover .name-display .full-name,body.dark .element:hover .name-display .full-name,body.dark-mode .element:hover .name-display .full-name{color:#f0f0f0 !important;border-bottom-color:#2a2a3e !important;}
body.dark-periodic .footer,body.dark .footer,body.dark-mode .footer{color:#606070 !important;}
#periodic-bottom-sheet{display:none;position:fixed;left:0;right:0;bottom:0;z-index:9999;background:#fff;border-radius:16px 16px 0 0;padding:16px 20px 24px;box-shadow:0 -8px 30px rgba(0,0,0,.2);transform:translateY(110%);transition:transform .3s ease;}
#periodic-bottom-sheet.open{transform:translateY(0);}
body.dark-periodic #periodic-bottom-sheet,body.dark #periodic-bottom-sheet,body.dark-mode #periodic-bottom-sheet{background:#1a1a2e;color:#f0f0f0;}
@media (max-width:768px){#periodic-bottom-sheet{display:block;}}
body.dark-periodic h1,body.dark h1,body.dark-mode h1,
body.dark-periodic h2,body.dark h2,body.dark-mode h2{color:#f0f0f0 !important;}
[data-theme="dark"]{color:#f0f0f0 !important;}
[data-theme="dark"] .element{background:#1a1a2e !important;border-color:#2a2a3e !important;}
[data-theme="dark"] .element .number,[data-theme="dark"] .element .symbol{color:#f0f0f0 !important;}
[data-theme="dark"] .element .full-name{color:#a0a0b0 !important;}
[data-theme="dark"] .info-display{background:#1a1a2e !important;border-color:#2a2a3e !important;color:#f0f0f0 !important;}
[data-theme="dark"] .legend{background:#12121a !important;}
[data-theme="dark"] .legend-item{color:#c0c0d0 !important;}
[data-theme="dark"] .info-display p{color:#b0b0c0 !important;}
[data-theme="dark"] .element:hover .name-display{background:#1a1a2e !important;color:#f0f0f0 !important;border-color:#2a2a3e !important;}
[data-theme="dark"] .element:hover .name-display .description{color:#b0b0c0 !important;}
[data-theme="dark"] .element:hover .name-display .full-name{color:#f0f0f0 !important;border-bottom-color:#2a2a3e !important;}
[data-theme="dark"] .footer{color:#606070 !important;}
[data-theme="dark"] #periodic-bottom-sheet{background:#1a1a2e;color:#f0f0f0;}
[data-theme="dark"] h1,[data-theme="dark"] h2{color:#f0f0f0 !important;}
