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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 219, 98, 0.2) 0%, transparent 50%);
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: auto;
}

header {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(30, 144, 255, 0.1) 100%);
    pointer-events: none;
}

header h1 {
    font-size: 3.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 
        0 0 20px rgba(138, 43, 226, 0.8),
        0 0 40px rgba(138, 43, 226, 0.4),
        0 0 60px rgba(138, 43, 226, 0.2);
    position: relative;
    z-index: 1;
}

header h1 i {
    margin-right: 0.5rem;
    animation: spin 20s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-container:hover {
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.search-container i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

#searchInput {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    width: 300px;
    background: transparent;
    color: #ffffff;
    outline: none;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#searchInput:focus {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.filter-container {
    display: flex;
    align-items: center;
}

#clearSearch, #categoryFilter, .glossary-close {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
    border: 1px solid rgba(124, 77, 255, 0.4);
    padding: 0.75rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    height: fit-content;
}

#clearSearch::before, #categoryFilter::before, .glossary-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

#clearSearch:hover, #categoryFilter:hover, .glossary-close:hover {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.3) 0%, rgba(138, 43, 226, 0.3) 100%);
    border-color: rgba(124, 77, 255, 0.6);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(124, 77, 255, 0.4),
        0 0 20px rgba(124, 77, 255, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
}

#clearSearch:hover::before, #categoryFilter:hover::before, .glossary-close:hover::before {
    left: 100%;
}

#clearSearch:active, #categoryFilter:active, .glossary-close:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 4px 15px rgba(124, 77, 255, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
}

#clearSearch i, #categoryFilter option, .glossary-close i {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(124, 77, 255, 0.8);
}

/* Special styling for select dropdown */
#categoryFilter {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    background-origin: border-box;
    background-clip: border-box;
}

#categoryFilter:hover {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    background-origin: border-box;
    background-clip: border-box;
}

#categoryFilter:active {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    background-origin: border-box;
    background-clip: border-box;
}

#categoryFilter option {
    background: #1a1a1a;
    color: #ffffff;
    text-shadow: none;
}

.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 6px;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.periodic-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.05) 0%, transparent 70%),
        radial-gradient(circle at 20% 80%, rgba(30, 144, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 20px;
}

.element {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 600;
    text-align: center;
    padding: 6px;
    min-height: 65px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.element::after {
    content: '🔗';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: rgba(255, 255, 255, 0.6);
}

.element:hover {
    transform: scale(1.15) translateZ(0);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.3);
}

.element:hover::before {
    opacity: 0.8;
}

.element:hover::after {
    opacity: 1;
}

.element.hidden {
    opacity: 0;
    transform: scale(0) rotateZ(180deg);
    pointer-events: none;
}

.atomic-number {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    position: absolute;
    top: 4px;
    left: 6px;
    font-weight: 400;
}

.symbol {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0.2rem 0;
    text-shadow: 0 0 10px currentColor;
}

.name {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    display: none;
}

.atomic-mass {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-weight: 400;
}

/* Element category colors with glow effects */
.alkali-metal { 
    background: linear-gradient(135deg, #ff006e, #ff4081);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
}

.alkali-metal:hover {
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.8), 0 0 60px rgba(255, 0, 110, 0.4);
}

.alkaline-earth-metal { 
    background: linear-gradient(135deg, #ffab00, #ffc107);
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 171, 0, 0.4);
}

.alkaline-earth-metal:hover {
    box-shadow: 0 0 30px rgba(255, 171, 0, 0.8), 0 0 60px rgba(255, 171, 0, 0.4);
}

.transition-metal { 
    background: linear-gradient(135deg, #00e676, #69f0ae);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.transition-metal:hover {
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.8), 0 0 60px rgba(0, 230, 118, 0.4);
}

.metalloid { 
    background: linear-gradient(135deg, #00bcd4, #4dd0e1);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.4);
}

.metalloid:hover {
    box-shadow: 0 0 30px rgba(0, 188, 212, 0.8), 0 0 60px rgba(0, 188, 212, 0.4);
}

.post-transition-metal { 
    background: linear-gradient(135deg, #7c4dff, #b388ff);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.4);
}

.post-transition-metal:hover {
    box-shadow: 0 0 30px rgba(124, 77, 255, 0.8), 0 0 60px rgba(124, 77, 255, 0.4);
}

.nonmetal { 
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: #000000;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.4);
}

.nonmetal:hover {
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.8), 0 0 60px rgba(79, 195, 247, 0.4);
}

.halogen { 
    background: linear-gradient(135deg, #ff5722, #ff7043);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 87, 34, 0.4);
}

.halogen:hover {
    box-shadow: 0 0 30px rgba(255, 87, 34, 0.8), 0 0 60px rgba(255, 87, 34, 0.4);
}

.noble-gas { 
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.4);
}

.noble-gas:hover {
    box-shadow: 0 0 30px rgba(233, 30, 99, 0.8), 0 0 60px rgba(233, 30, 99, 0.4);
}

.lanthanide { 
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

.lanthanide:hover {
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.8), 0 0 60px rgba(255, 152, 0, 0.4);
}

.actinide { 
    background: linear-gradient(135deg, #9c27b0, #ba68c8);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.4);
}

.actinide:hover {
    box-shadow: 0 0 30px rgba(156, 39, 176, 0.8), 0 0 60px rgba(156, 39, 176, 0.4);
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: #ffffff;
    padding: 1.5rem;
    border-radius: 15px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 300px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.tooltip.show {
    opacity: 1;
}

.tooltip h3 {
    margin-bottom: 1rem;
    color: #7c4dff;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(124, 77, 255, 0.8);
}

.tooltip p {
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.9);
}

/* About Section Styles */
.about {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.about h2 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.about h2::before {
    content: '🧪';
    font-size: 2rem;
}

.about p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
    text-align: left;
}

.about p::first-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7c4dff;
    text-shadow: 0 0 10px rgba(124, 77, 255, 0.8);
}

footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced Footer Styles */
.footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

.footer-title i {
    color: #7c4dff;
    animation: spin 20s linear infinite;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: #7c4dff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.2);
}

.footer-link:hover {
    background: rgba(124, 77, 255, 0.2);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.glossary-toggle {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
    border: 1px solid rgba(124, 77, 255, 0.4);
    padding: 0.75rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.glossary-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.glossary-toggle:hover {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.3) 0%, rgba(138, 43, 226, 0.3) 100%);
    border-color: rgba(124, 77, 255, 0.6);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(124, 77, 255, 0.4),
        0 0 20px rgba(124, 77, 255, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
}

.glossary-toggle:hover::before {
    left: 100%;
}

.glossary-toggle:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 4px 15px rgba(124, 77, 255, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.glossary-toggle i {
    font-size: 1rem;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(124, 77, 255, 0.8);
    animation: bookGlow 2s ease-in-out infinite alternate;
}

@keyframes bookGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(124, 77, 255, 0.6));
    }
    to {
        filter: drop-shadow(0 0 15px rgba(124, 77, 255, 1));
    }
}

/* Glossary Section Styles */
.glossary-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(124, 77, 255, 0.3);
    position: relative;
}

.glossary-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(124, 77, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.glossary-section.active {
    max-height: 2000px;
    transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.glossary-content {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.glossary-title {
    font-size: 2.5rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 0 0 30px rgba(124, 77, 255, 0.8);
    position: relative;
}

.glossary-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #7c4dff, transparent);
    border-radius: 2px;
}

.glossary-title i {
    color: #7c4dff;
    animation: spin 20s linear infinite;
    filter: drop-shadow(0 0 20px rgba(124, 77, 255, 0.8));
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.glossary-category {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(40, 40, 40, 0.9) 100%);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glossary-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7c4dff, #8a2be2, #7c4dff);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.glossary-category:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px rgba(124, 77, 255, 0.3),
        0 0 30px rgba(124, 77, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 77, 255, 0.5);
}

.glossary-category h4 {
    color: #7c4dff;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(124, 77, 255, 0.3);
    padding-bottom: 1rem;
    text-shadow: 0 0 15px rgba(124, 77, 255, 0.6);
}

.glossary-category h4 i {
    font-size: 1.2rem;
    animation: iconPulse 2s ease-in-out infinite alternate;
}

@keyframes iconPulse {
    from { 
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(124, 77, 255, 0.6));
    }
    to { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(124, 77, 255, 1));
    }
}

.glossary-category dl {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glossary-category dt {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    position: relative;
    padding-left: 1rem;
}

.glossary-category dt::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #7c4dff;
    font-size: 0.8rem;
    animation: bulletGlow 2s ease-in-out infinite alternate;
}

@keyframes bulletGlow {
    from { color: rgba(124, 77, 255, 0.6); }
    to { color: rgba(124, 77, 255, 1); }
}

.glossary-category dd {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-left: 0;
    padding-left: 1rem;
    border-left: 3px solid rgba(124, 77, 255, 0.3);
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.05) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.glossary-category dd:hover {
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.1) 0%, transparent 100%);
    border-left-color: rgba(124, 77, 255, 0.6);
    color: rgba(255, 255, 255, 0.95);
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    border-bottom: 2px solid rgba(124, 77, 255, 0.5);
    padding-bottom: 0.5rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-list li {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    transition: all 0.3s ease;
}

.footer-list li:hover {
    color: #ffffff;
    transform: translateX(3px);
}

.footer-list i {
    color: #7c4dff;
    width: 16px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 50%;
    color: #7c4dff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.social-link:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.4);
    color: #ffffff;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright, .made-by {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.made-by a {
    color: #7c4dff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.made-by a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(124, 77, 255, 0.8);
}

.made-by i {
    color: #ff4081;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive design */
@media (max-width: 1200px) {
    .periodic-table {
        gap: 4px;
        padding: 1.5rem;
    }
    
    .element {
        min-height: 55px;
        font-size: 0.9rem;
    }
    
    .symbol {
        font-size: 1.1rem;
    }
}

@media (max-width: 1024px) {
    main {
        padding: 1rem;
    }
    
    .periodic-table {
        gap: 3px;
        padding: 1rem;
        transform: scale(0.9);
        transform-origin: center;
    }
    
    .element {
        min-height: 50px;
        padding: 4px;
    }
    
    .symbol {
        font-size: 1rem;
    }
    
    .atomic-number {
        font-size: 0.6rem;
        top: 2px;
        left: 3px;
    }
    
    .atomic-mass {
        font-size: 0.4rem;
        bottom: 2px;
        right: 3px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .search-container {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }
    
    #searchInput {
        width: 100%;
        flex: 1;
    }
    
    #categoryFilter {
        width: 100%;
        max-width: 350px;
    }
    
    .periodic-table {
        gap: 2px;
        padding: 0.8rem;
        margin: 1rem;
        transform: scale(0.7);
        transform-origin: center;
        overflow: visible;
    }
    
    .element {
        min-height: 45px;
        padding: 3px;
        border-radius: 8px;
    }
    
    .element:hover {
        transform: scale(1.1);
    }
    
    .symbol {
        font-size: 0.95rem;
        margin: 0.1rem 0;
    }
    
    .atomic-number, .atomic-mass {
        display: none;
    }
    
    .tooltip {
        max-width: 250px;
        padding: 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .periodic-table {
        transform: scale(0.6);
        padding: 0.6rem;
        margin: 0.5rem;
    }
    
    .element {
        min-height: 42px;
        padding: 2px;
        border-radius: 6px;
    }
    
    .symbol {
        font-size: 0.85rem;
    }
    
    .element:hover {
        transform: scale(1.12);
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    main {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .controls {
        gap: 0.8rem;
    }
    
    .search-container {
        padding: 0.4rem 0.8rem;
        max-width: 300px;
    }
    
    #searchInput {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    #clearSearch, #categoryFilter {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .periodic-table {
        transform: scale(0.5);
        gap: 1px;
        padding: 0.5rem;
        margin: 0.5rem;
        border-radius: 12px;
        min-width: 900px;
        overflow-x: auto;
    }
    
    .element {
        min-height: 38px;
        padding: 2px;
        border-radius: 4px;
        font-size: 0.8rem;
    }
    
    .element:hover {
        transform: scale(1.15);
        z-index: 20;
    }
    
    .symbol {
        font-size: 0.8rem;
        margin: 0;
    }
    
    .tooltip {
        max-width: 200px;
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .tooltip h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .tooltip p {
        margin: 0.3rem 0;
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .periodic-table {
        transform: scale(0.45);
        min-width: 1000px;
    }
    
    .element {
        min-height: 35px;
        font-size: 0.75rem;
    }
    
    .symbol {
        font-size: 0.75rem;
    }
    
    .search-container {
        max-width: 280px;
    }
    
    #searchInput::placeholder {
        font-size: 0.8rem;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .controls {
        flex-direction: row;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .periodic-table {
        transform: scale(0.8);
        padding: 0.5rem;
        margin: 0.5rem;
    }
    
    .element {
        min-height: 40px;
    }
    
    /* Footer responsive */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Small screens - use horizontal scroll */
@media (max-width: 480px) {
    main {
        padding: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .periodic-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 0;
    }
    
    .periodic-table {
        min-width: 900px;
        transform: none;
        margin: 0 auto;
    }
    
    /* Footer responsive */
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .footer-title {
        font-size: 1.3rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }
    
    .copyright, .made-by {
        font-size: 0.8rem;
    }
    
    /* Glossary responsive */
    .glossary-content {
        padding: 1rem;
    }
    
    .glossary-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .glossary-category {
        padding: 1rem;
    }
    
    .glossary-category h4 {
        font-size: 1.1rem;
    }
    
    .glossary-category dt {
        font-size: 0.9rem;
    }
    
    .glossary-category dd {
        font-size: 0.8rem;
    }
    
    /* About section responsive */
    .about {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
    
    .about h2 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .about h2::before {
        font-size: 1.5rem;
    }
    
    .about p {
        font-size: 1rem;
        line-height: 1.6;
        text-align: left;
    }
    
    .about p::first-letter {
        font-size: 1.3rem;
    }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.8);
}
