body {
      box-sizing: border-box;
      margin: 0;
      padding: 20px;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100%;
      overflow-x: auto;
      position: relative;
    }

    .loader-container {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      animation: loaderFadeOut 0.8s ease-out 3s forwards;
    }

    .loader-content {
      text-align: center;
      color: white;
      animation: loaderPulse 2s ease-in-out infinite;
    }

    .atom-loader {
      position: relative;
      width: 120px;
      height: 120px;
      margin: 0 auto 30px;
      animation: atomSpin 3s linear infinite;
    }

    .atom-nucleus {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 20px;
      height: 20px;
      background: radial-gradient(circle, #ffd700 0%, #ff6b6b 50%, #ee5a6f 100%);
      border-radius: 50%;
      box-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,107,107,0.6);
      animation: nucleusPulse 1.5s ease-in-out infinite;
    }

    .atom-orbit {
      position: absolute;
      border: 2px solid rgba(255,255,255,0.4);
      border-radius: 50%;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    .atom-orbit-1 {
      width: 40px;
      height: 40px;
      animation: orbitRotate 1.5s linear infinite;
      border-color: #ff6b6b;
    }

    .atom-orbit-2 {
      width: 70px;
      height: 70px;
      animation: orbitRotate 2.5s linear infinite reverse;
      border-color: #48dbfb;
    }

    .atom-orbit-3 {
      width: 100px;
      height: 100px;
      animation: orbitRotate 3.5s linear infinite;
      border-color: #5f27cd;
    }

    .atom-electron {
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      top: -4px;
      left: 50%;
      transform: translateX(-50%);
    }

    .atom-orbit-1 .atom-electron {
      background: radial-gradient(circle, #ff6b6b 0%, #ffffff 100%);
      box-shadow: 0 0 10px #ff6b6b;
    }

    .atom-orbit-2 .atom-electron {
      background: radial-gradient(circle, #48dbfb 0%, #ffffff 100%);
      box-shadow: 0 0 10px #48dbfb;
    }

    .atom-orbit-3 .atom-electron {
      background: radial-gradient(circle, #5f27cd 0%, #ffffff 100%);
      box-shadow: 0 0 10px #5f27cd;
    }

    .loader-title {
      font-size: 32px;
      font-weight: bold;
      margin: 0 0 20px 0;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
      animation: titleGlow 2s ease-in-out infinite alternate;
    }

    .loader-progress {
      width: 300px;
      height: 6px;
      background: rgba(255,255,255,0.2);
      border-radius: 10px;
      margin: 0 auto 15px;
      overflow: hidden;
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    }

    .loader-bar {
      height: 100%;
      background: linear-gradient(90deg, #ff6b6b 0%, #48dbfb 50%, #5f27cd 100%);
      border-radius: 10px;
      animation: progressFill 3s ease-out forwards;
      box-shadow: 0 0 10px rgba(255,255,255,0.5);
    }

    .loader-text {
      font-size: 16px;
      margin: 0;
      opacity: 0.9;
      animation: textPulse 1.5s ease-in-out infinite;
    }

    @keyframes loaderFadeOut {
      0% {
        opacity: 1;
        visibility: visible;
      }
      100% {
        opacity: 0;
        visibility: hidden;
      }
    }

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

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

    @keyframes orbitRotate {
      from {
        transform: translate(-50%, -50%) rotate(0deg);
      }
      to {
        transform: translate(-50%, -50%) rotate(360deg);
      }
    }

    @keyframes nucleusPulse {
      0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,107,107,0.6);
      }
      50% {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 30px rgba(255,215,0,1), 0 0 60px rgba(255,107,107,0.8);
      }
    }

    @keyframes titleGlow {
      0% {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.3);
      }
      100% {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 30px rgba(255,255,255,0.6);
      }
    }

    @keyframes progressFill {
      0% {
        width: 0%;
      }
      100% {
        width: 100%;
      }
    }

    @keyframes textPulse {
      0%, 100% {
        opacity: 0.7;
      }
      50% {
        opacity: 1;
      }
    }

    #main-content {
      opacity: 0;
      animation: mainContentFadeIn 1s ease-out 3.5s forwards;
    }

    @keyframes mainContentFadeIn {
      0% {
        opacity: 0;
        transform: translateY(30px);
      }
      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .background-particles {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: -1;
      overflow: hidden;
    }

    .gas-particle {
      position: absolute;
      border-radius: 50%;
      opacity: 0.1;
      animation: floatAndRotate 15s infinite linear;
    }

    .gas-particle.hydrogen {
      width: 8px;
      height: 8px;
      background: radial-gradient(circle, #ff6b6b 0%, #ee5a6f 100%);
      box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    }

    .gas-particle.helium {
      width: 6px;
      height: 6px;
      background: radial-gradient(circle, #c44569 0%, #a5305e 100%);
      box-shadow: 0 0 8px rgba(196, 69, 105, 0.3);
    }

    .gas-particle.oxygen {
      width: 10px;
      height: 10px;
      background: radial-gradient(circle, #5f27cd 0%, #341f97 100%);
      box-shadow: 0 0 12px rgba(95, 39, 205, 0.3);
    }

    .gas-particle.nitrogen {
      width: 9px;
      height: 9px;
      background: radial-gradient(circle, #48dbfb 0%, #0abde3 100%);
      box-shadow: 0 0 11px rgba(72, 219, 251, 0.3);
    }

    .gas-particle.carbon {
      width: 7px;
      height: 7px;
      background: radial-gradient(circle, #333333 0%, #1a1a1a 100%);
      box-shadow: 0 0 9px rgba(51, 51, 51, 0.4);
    }

    @keyframes floatAndRotate {
      0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.5);
        opacity: 0;
      }
      10% {
        opacity: 0.1;
      }
      90% {
        opacity: 0.1;
      }
      100% {
        transform: translateY(-100px) translateX(200px) rotate(360deg) scale(1.2);
        opacity: 0;
      }
    }

    @keyframes floatAndRotateReverse {
      0% {
        transform: translateY(100vh) translateX(0) rotate(360deg) scale(1.2);
        opacity: 0;
      }
      10% {
        opacity: 0.1;
      }
      90% {
        opacity: 0.1;
      }
      100% {
        transform: translateY(-100px) translateX(-200px) rotate(0deg) scale(0.5);
        opacity: 0;
      }
    }

    .gas-particle:nth-child(even) {
      animation: floatAndRotateReverse 20s infinite linear;
    }

    .gas-particle:nth-child(3n) {
      animation-duration: 18s;
    }

    .gas-particle:nth-child(4n) {
      animation-duration: 22s;
    }

    .gas-particle:nth-child(5n) {
      animation-duration: 16s;
    }

    * {
      box-sizing: border-box;
    }

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

    .header {
      text-align: center;
      margin-bottom: 30px;
      animation: fadeInDown 0.8s ease-out;
    }

    .header h1 {
      color: #ffffff;
      font-size: 48px;
      margin: 0 0 10px 0;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }

    .header p {
      color: #e0e7ff;
      font-size: 18px;
      margin: 0;
    }

    .legend {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin-bottom: 20px;
      flex-wrap: wrap;
      animation: fadeIn 1s ease-out 0.3s both;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(255,255,255,0.1);
      padding: 8px 16px;
      border-radius: 20px;
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
      cursor: pointer;
      border: 2px solid transparent;
    }

    .legend-item:hover {
      transform: translateY(-2px);
      background: rgba(255,255,255,0.2);
    }

    .legend-item.active {
      background: rgba(255,255,255,0.3);
      border: 2px solid rgba(255,255,255,0.5);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .element.filtered-out {
      opacity: 0.1;
      transform: scale(0.9);
      pointer-events: none;
    }

    .legend-color {
      width: 20px;
      height: 20px;
      border-radius: 4px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    .legend-text {
      color: #ffffff;
      font-size: 14px;
      font-weight: 500;
    }

    .periodic-table {
      display: grid;
      grid-template-columns: repeat(18, minmax(40px, 1fr));
      grid-template-rows: repeat(9, minmax(40px, 1fr));
      gap: 4px;
      background: rgba(255,255,255,0.05);
      padding: 25px;
      border-radius: 20px;
      backdrop-filter: blur(10px);
      box-shadow: 0 8px 32px rgba(0,0,0,0.3);
      max-width: 100%;
      overflow-x: auto;
      margin: 0 auto;
      justify-content: center;
      align-items: center;
      justify-items: center;
    }

    .element {
      width: 100%;
      height: 100%;
      min-width: 42px;
      min-height: 42px;
      aspect-ratio: 1;
      border-radius: 15px;
      padding: 6px;
      cursor: pointer;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 5px 15px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
      animation: scaleIn 0.5s ease-out both;
      transform-origin: center;
      text-align: center;
      overflow: visible;
      margin: 2px;
      border: 2px solid rgba(255,255,255,0.15);
      backdrop-filter: blur(5px);
    }

    .electron-orbits {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100%;
      height: 100%;
      pointer-events: none;
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      transform-style: preserve-3d;
    }

    .element:hover .electron-orbits {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.1) rotateZ(10deg);
    }

    .orbit {
      position: absolute;
      border: 2px solid rgba(255,255,255,0.4);
      border-radius: 50%;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      box-shadow: 0 0 10px rgba(255,255,255,0.2);
    }

    .orbit-1 {
      width: 25%;
      height: 25%;
      animation: rotate 1.5s linear infinite, orbitPulse 3s ease-in-out infinite;
      border-color: #ff6b6b;
    }

    .orbit-2 {
      width: 45%;
      height: 45%;
      animation: rotate 2.5s linear infinite reverse, orbitPulse 4s ease-in-out infinite 0.5s;
      border-color: #48dbfb;
    }

    .orbit-3 {
      width: 65%;
      height: 65%;
      animation: rotate 3.5s linear infinite, orbitPulse 5s ease-in-out infinite 1s;
      border-color: #5f27cd;
    }

    @keyframes orbitPulse {
      0%, 100% { 
        border-width: 2px;
        box-shadow: 0 0 10px rgba(255,255,255,0.2);
      }
      50% { 
        border-width: 3px;
        box-shadow: 0 0 20px rgba(255,255,255,0.4);
      }
    }

    .electron {
      position: absolute;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      animation: electronGlow 2s ease-in-out infinite;
    }

    .electron-1 {
      top: -2px;
      left: 50%;
      transform: translateX(-50%);
      background: radial-gradient(circle, #ff6b6b 0%, #ffffff 100%);
      box-shadow: 0 0 8px #ff6b6b, 0 0 15px rgba(255,107,107,0.5);
      animation: electronGlow 1.8s ease-in-out infinite, electronTrail 1.5s linear infinite;
    }

    .electron-2 {
      top: -2px;
      left: 50%;
      transform: translateX(-50%);
      background: radial-gradient(circle, #48dbfb 0%, #ffffff 100%);
      box-shadow: 0 0 8px #48dbfb, 0 0 15px rgba(72,219,251,0.5);
      animation: electronGlow 2.2s ease-in-out infinite 0.3s, electronTrail 2.5s linear infinite reverse;
    }

    .electron-3 {
      top: -2px;
      left: 50%;
      transform: translateX(-50%);
      background: radial-gradient(circle, #5f27cd 0%, #ffffff 100%);
      box-shadow: 0 0 8px #5f27cd, 0 0 15px rgba(95,39,205,0.5);
      animation: electronGlow 2.6s ease-in-out infinite 0.6s, electronTrail 3.5s linear infinite;
    }

    @keyframes electronGlow {
      0%, 100% { 
        transform: translateX(-50%) scale(1);
        opacity: 1;
      }
      50% { 
        transform: translateX(-50%) scale(1.3);
        opacity: 0.8;
      }
    }

    @keyframes electronTrail {
      0% { 
        box-shadow: 0 0 8px currentColor, 0 0 15px currentColor;
      }
      50% { 
        box-shadow: 0 0 12px currentColor, 0 0 25px currentColor, 0 0 35px currentColor;
      }
      100% { 
        box-shadow: 0 0 8px currentColor, 0 0 15px currentColor;
      }
    }

    .nucleus {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 10px;
      height: 10px;
      background: radial-gradient(circle, #ffd700 0%, #ff6b6b 50%, #ee5a6f 100%);
      border-radius: 50%;
      box-shadow: 0 0 10px rgba(255,215,0,0.8), 0 0 20px rgba(255,107,107,0.6);
      animation: nucleusPulse 2s ease-in-out infinite, nucleusRotate 4s linear infinite;
    }

    .element:hover .nucleus {
      animation: nucleusPulse 1s ease-in-out infinite, nucleusRotate 2s linear infinite, nucleusExcited 0.5s ease-in-out infinite;
    }

    @keyframes nucleusPulse {
      0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255,215,0,0.8), 0 0 20px rgba(255,107,107,0.6);
      }
      50% { 
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 15px rgba(255,215,0,1), 0 0 30px rgba(255,107,107,0.8);
      }
    }

    @keyframes nucleusRotate {
      from { 
        background: radial-gradient(circle, #ffd700 0%, #ff6b6b 50%, #ee5a6f 100%);
      }
      25% { 
        background: radial-gradient(circle, #ff6b6b 0%, #ffd700 50%, #ee5a6f 100%);
      }
      50% { 
        background: radial-gradient(circle, #ee5a6f 0%, #ff6b6b 50%, #ffd700 100%);
      }
      75% { 
        background: radial-gradient(circle, #ffd700 0%, #ee5a6f 50%, #ff6b6b 100%);
      }
      to { 
        background: radial-gradient(circle, #ffd700 0%, #ff6b6b 50%, #ee5a6f 100%);
      }
    }

    @keyframes nucleusExcited {
      0%, 100% { 
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
      }
      50% { 
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
      }
    }

    @keyframes rotate {
      from { transform: translate(-50%, -50%) rotate(0deg); }
      to { transform: translate(-50%, -50%) rotate(360deg); }
    }

    @keyframes pulse {
      0%, 100% { transform: translate(-50%, -50%) scale(1); }
      50% { transform: translate(-50%, -50%) scale(1.2); }
    }

    .element:hover {
      transform: scale(1.3) translateY(-12px) rotateX(10deg) rotateY(15deg) rotateZ(2deg);
      box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.2);
      z-index: 10;
      animation: elementGlow 0.6s ease-in-out, elementFloat 2s ease-in-out infinite;
      border: 3px solid rgba(255,255,255,0.4);
    }

    @keyframes elementFloat {
      0%, 100% { 
        transform: scale(1.3) translateY(-12px) rotateX(10deg) rotateY(15deg) rotateZ(2deg);
      }
      50% { 
        transform: scale(1.35) translateY(-16px) rotateX(12deg) rotateY(18deg) rotateZ(-2deg);
      }
    }

    @keyframes elementGlow {
      0% { box-shadow: 0 15px 35px rgba(0,0,0,0.5); }
      50% { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 30px rgba(255,255,255,0.5); }
      100% { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.3); }
    }

    .element::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
      border-radius: 12px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

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

    .element-tooltip {
      position: absolute;
      top: -120px;
      left: 50%;
      transform: translateX(-50%);
      background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(30,30,30,0.95) 100%);
      color: white;
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 12px;
      white-space: nowrap;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1000;
      box-shadow: 0 8px 25px rgba(0,0,0,0.4);
      border: 1px solid rgba(255,255,255,0.2);
      backdrop-filter: blur(10px);
      pointer-events: none;
    }

    .element-tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 6px solid transparent;
      border-top-color: rgba(0,0,0,0.95);
    }

    .element:hover .element-tooltip {
      opacity: 1;
      visibility: visible;
      transform: translateX(-50%) translateY(-10px);
    }

    .tooltip-line {
      display: block;
      margin: 2px 0;
    }

    .tooltip-label {
      color: #ffd700;
      font-weight: 600;
    }

    .atomic-number {
      font-size: 10px;
      font-weight: 600;
      opacity: 0.8;
    }

    .symbol {
      font-size: 24px;
      font-weight: bold;
      text-align: center;
      margin: auto 0;
    }

    .name {
      font-size: 9px;
      text-align: center;
      opacity: 0.9;
      font-weight: 500;
    }

    .mass {
      margin-bottom: 1000px;
      font-size: 8px;
      text-align: center;
      opacity: 0.7;
    }

    .empty {
      background: transparent !important;
      box-shadow: none !important;
      cursor: default;
      animation: none;
    }

    .empty:hover {
      transform: none;
    }

    .alkali-metal { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%); color: white; }
    .alkaline-earth { background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%); color: #333; }
    .transition-metal { background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%); color: white; }
    .post-transition { background: linear-gradient(135deg, #1dd1a1 0%, #10ac84 100%); color: white; }
    .metalloid { background: linear-gradient(135deg, #54a0ff 0%, #2e86de 100%); color: white; }
    .nonmetal { background: linear-gradient(135deg, #5f27cd 0%, #341f97 100%); color: white; }
    .halogen { background: linear-gradient(135deg, #00d2d3 0%, #01a3a4 100%); color: white; }
    .noble-gas { background: linear-gradient(135deg, #c44569 0%, #a5305e 100%); color: white; }
    .lanthanide { background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%); color: white; }
    .actinide { background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%); color: white; }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.8);
      backdrop-filter: blur(5px);
      z-index: 1000;
      animation: fadeIn 0.3s ease-out;
    }

    .modal-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      padding: 40px;
      border-radius: 20px;
      max-width: 500px;
      width: 90%;
      box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(102,126,234,0.3);
      animation: modalEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
      color: white;
      border: 2px solid rgba(255,255,255,0.2);
      backdrop-filter: blur(20px);
    }

    @keyframes modalEntrance {
      0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.7) rotateY(-15deg);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
      }
      50% {
        opacity: 0.8;
        transform: translate(-50%, -45%) scale(1.05) rotateY(5deg);
        box-shadow: 0 25px 70px rgba(0,0,0,0.6), 0 0 50px rgba(102,126,234,0.4);
      }
      100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
        box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(102,126,234,0.3);
      }
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .modal-title {
      font-size: 36px;
      font-weight: bold;
    }

    .close-btn {
      background: rgba(255,255,255,0.2);
      border: none;
      color: white;
      font-size: 28px;
      cursor: pointer;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
    }

    .close-btn:hover {
      background: rgba(255,255,255,0.3);
      transform: rotate(90deg);
    }

    .modal-body {
      line-height: 1.8;
    }

    .modal-body p {
      margin: 10px 0;
      font-size: 16px;
    }

    .modal-body strong {
      color: #ffd700;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes fadeInDown {
      from {
        opacity: 0;
        transform: translateY(-30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes scaleIn {
      0% {
        opacity: 0;
        transform: scale(0.3) rotateY(180deg) rotateX(90deg);
        filter: blur(10px);
      }
      50% {
        opacity: 0.7;
        transform: scale(1.1) rotateY(0deg) rotateX(0deg);
        filter: blur(2px);
      }
      100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg) rotateX(0deg);
        filter: blur(0px);
      }
    }

    @keyframes introWave {
      0% {
        transform: translateY(100px) scale(0.5) rotateZ(45deg);
        opacity: 0;
        filter: blur(20px);
      }
      60% {
        transform: translateY(-20px) scale(1.1) rotateZ(-5deg);
        opacity: 0.8;
        filter: blur(5px);
      }
      100% {
        transform: translateY(0) scale(1) rotateZ(0deg);
        opacity: 1;
        filter: blur(0px);
      }
    }

    .header {
      animation: introWave 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    .legend {
      animation: introWave 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
    }

    .periodic-table {
      animation: introWave 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translate(-50%, -40%);
      }
      to {
        opacity: 1;
        transform: translate(-50%, -50%);
      }
    }

    @keyframes elementClick {
      0% { 
        transform: scale(1.2) translateY(-8px) rotateY(5deg);
      }
      50% { 
        transform: scale(1.4) translateY(-12px) rotateY(-5deg) rotateZ(5deg);
        box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 30px rgba(255,255,255,0.5);
      }
      100% { 
        transform: scale(1.2) translateY(-8px) rotateY(5deg);
      }
    }

    @keyframes symbolPulse {
      0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255,255,255,0.5);
      }
      50% { 
        transform: scale(1.1);
        text-shadow: 0 0 20px rgba(255,255,255,0.8), 0 0 30px rgba(255,215,0,0.6);
      }
    }

    .element-info-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      margin-top: 20px;
    }

    .info-item {
      background: rgba(255,255,255,0.1);
      padding: 12px;
      border-radius: 10px;
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255,255,255,0.2);
      transition: all 0.3s ease;
    }

    .info-item:hover {
      background: rgba(255,255,255,0.15);
      transform: translateY(-2px);
    }

    .info-item.full-width {
      grid-column: 1 / -1;
    }

    .info-label {
      font-weight: 600;
      color: #ffd700;
      display: block;
      margin-bottom: 5px;
      font-size: 14px;
    }

    .info-value {
      color: #ffffff;
      font-size: 16px;
      line-height: 1.4;
    }

    .category-badge {
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: inline-block;
      margin-top: 5px;
    }

    @media (max-width: 1400px) {
      .periodic-table {
        grid-template-columns: repeat(18, minmax(35px, 1fr));
        grid-template-rows: repeat(9, minmax(35px, 1fr));
        gap: 2px;
        padding: 15px;
      }
      
      .element {
        min-width: 35px;
        min-height: 35px;
        padding: 3px;
      }
      
      .symbol {
        font-size: 16px;
      }
      
      .atomic-number {
        font-size: 8px;
      }
      
      .name, .mass {
        font-size: 6px;
      }
    }

    @media (max-width: 1024px) {
      .periodic-table {
        grid-template-columns: repeat(18, minmax(30px, 1fr));
        grid-template-rows: repeat(9, minmax(30px, 1fr));
        gap: 2px;
        padding: 10px;
      }
      
      .element {
        min-width: 30px;
        min-height: 30px;
        padding: 2px;
      }
      
      .symbol {
        font-size: 14px;
      }
      
      .atomic-number {
        font-size: 7px;
      }
      
      .name, .mass {
        font-size: 5px;
      }
      
      .header h1 {
        font-size: 36px;
      }
      
      .header p {
        font-size: 16px;
      }
    }

    @media (max-width: 768px) {
      .container {
        padding: 10px;
      }
      
      .periodic-table {
        grid-template-columns: repeat(18, minmax(25px, 1fr));
        grid-template-rows: repeat(9, minmax(25px, 1fr));
        gap: 1px;
        padding: 8px;
        border-radius: 15px;
      }
      
      .element {
        min-width: 25px;
        min-height: 25px;
        padding: 1px;
        border-radius: 4px;
      }
      
      .symbol {
        font-size: 12px;
      }
      
      .atomic-number {
        font-size: 6px;
      }
      
      .name, .mass {
        font-size: 4px;
      }
      
      .header h1 {
        font-size: 28px;
      }
      
      .header p {
        font-size: 14px;
      }
      
      .legend {
        gap: 10px;
      }
      
      .legend-item {
        padding: 6px 12px;
      }
      
      .legend-text {
        font-size: 12px;
      }
      
      .modal-content {
        padding: 30px;
        width: 95%;
      }
    }

    @media (max-width: 480px) {
      body {
        padding: 10px;
      }
      
      .periodic-table {
        grid-template-columns: repeat(18, minmax(20px, 1fr));
        grid-template-rows: repeat(9, minmax(20px, 1fr));
        gap: 1px;
        padding: 5px;
      }
      
      .element {
        min-width: 20px;
        min-height: 20px;
        padding: 1px;
      }
      
      .symbol {
        font-size: 10px;
      }
      
      .atomic-number {
        font-size: 5px;
      }
      
      .name, .mass {
        display: none;
      }
      
      .header h1 {
        font-size: 24px;
      }
      
      .header p {
        font-size: 12px;
      }
      
      .legend {
        flex-direction: column;
        gap: 8px;
      }
      
      .legend-item {
        padding: 4px 8px;
        justify-content: center;
      }
      
      .footer {
        margin-top: 20px;
      }
      
      .developer-card {
        padding: 15px;
      }
      
      .developer-info h3 {
        font-size: 16px;
      }
      
      .developer-info p {
        font-size: 12px;
      }
      
      .social-links {
        gap: 8px;
      }
      
      .social-link {
        width: 35px;
        height: 35px;
      }
    }

    .footer {
      margin-top: 40px;
      padding: 20px 0;
      border-top: 1px solid rgba(255,255,255,0.1);
    }

    .developer-card {
      background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
      backdrop-filter: blur(15px);
      border-radius: 25px;
      padding: 30px;
      text-align: center;
      box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      border: 2px solid rgba(255,255,255,0.1);
      position: relative;
      overflow: hidden;
    }

    .developer-card::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
      transform: rotate(45deg);
      transition: all 0.6s ease;
      opacity: 0;
    }

    .developer-card:hover {
      transform: translateY(-8px) scale(1.02);
      box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(102,126,234,0.3);
      border: 2px solid rgba(255,255,255,0.3);
    }

    .developer-card:hover::before {
      opacity: 1;
      transform: rotate(45deg) translate(50%, 50%);
    }

    .developer-profile {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 20px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .profile-image-btn {
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
      position: relative;
      transition: all 0.3s ease;
    }

    .profile-image-btn:hover {
      transform: scale(1.05);
    }

    .profile-image {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: url('https://avatars.githubusercontent.com/salahuddingfx') center/cover;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32px;
      color: white;
      font-weight: bold;
      box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px rgba(102,126,234,0.3);
      animation: profilePulse 3s ease-in-out infinite;
      border: 4px solid rgba(255,255,255,0.2);
      position: relative;
      overflow: hidden;
    }

    .profile-image::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 50%;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .profile-image::after {
      content: '👨‍💻';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 40px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .profile-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.8);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: all 0.3s ease;
      backdrop-filter: blur(5px);
    }

    .profile-text {
      color: white;
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

    .profile-image-btn:hover .profile-overlay {
      opacity: 1;
    }

    .profile-image-btn:hover .profile-image::before {
      opacity: 0.2;
    }

    .profile-image-btn:hover .profile-image::after {
      opacity: 0.3;
    }

    .developer-info h3 {
      color: #ffffff;
      font-size: 28px;
      margin: 0 0 8px 0;
      font-weight: 700;
      text-shadow: 0 2px 4px rgba(0,0,0,0.3);
      background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .developer-info p {
      color: #e0e7ff;
      font-size: 18px;
      margin: 0 0 10px 0;
      opacity: 0.95;
      font-weight: 500;
    }

    .developer-stats {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin: 15px 0;
      flex-wrap: wrap;
    }

    .stat-item {
      background: rgba(255,255,255,0.1);
      padding: 8px 16px;
      border-radius: 20px;
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255,255,255,0.2);
      transition: all 0.3s ease;
    }

    .stat-item:hover {
      background: rgba(255,255,255,0.2);
      transform: translateY(-2px);
    }

    .stat-number {
      display: block;
      font-size: 20px;
      font-weight: bold;
      color: #ffd700;
    }

    .stat-label {
      font-size: 12px;
      color: #e0e7ff;
      opacity: 0.8;
    }

    .social-links {
      display: flex;
      justify-content: center;
      gap: 15px;
      margin-top: 20px;
    }

    .social-link {
      width: 45px;
      height: 45px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      color: white;
      font-size: 20px;
      transition: all 0.3s ease;
      box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .social-link.github {
      background: linear-gradient(135deg, #333333 0%, #24292e 100%);
    }

    .social-link.linkedin {
      background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
    }

    .social-link.twitter {
      background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    }

    .social-link.email {
      background: linear-gradient(135deg, #ea4335 0%, #d33b2c 100%);
    }

    .social-link.portfolio {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .social-link:hover {
      transform: translateY(-3px) scale(1.1);
      box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }

    @keyframes profilePulse {
      0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
      }
      50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(102,126,234,0.4);
      }
    }