:root {
  --background-color: #0a0a0a50;
  --surface-color: #00000050;
  --primary-color: #f39c12;
  --text-color: #e5e5e5;
  --border-color: #f39c12;
  --font-family: "Poppins", sans-serif;
}

body {
  background-color: #000;
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  backdrop-filter: blur(6px);
  overflow-x: hidden;
}

#app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.main-container {
  flex-grow: 1;
  overflow: auto;
  padding: 1.5rem;
}

.grid-layout {
  display: grid;
  height: 100%;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-template-areas:
    "json-editor json-editor top-contestants"
    "code-compiler file-upload top-contestants";
}

.grid-item {
  background-color: var(--surface-color);
  border-radius: 12px;
  border: 1px solid #e5e5e53f;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.component-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(11px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 12px;
}

.component-overlay p {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 500;
}

.json-editor-container {
  grid-area: json-editor;
}
.file-upload-container {
  grid-area: file-upload;
}
.code-compiler-container {
  grid-area: code-compiler;
}
.top-contestants-container {
  grid-area: top-contestants;
}

.json-editor-container,
.code-compiler-container {
  padding: 0;
  border: none;
  background-color: transparent;
}

@keyframes expand-smooth {
  from {
    transform: scale(0.98);
    opacity: 0.7;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.grid-item.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  animation: expand-smooth 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.grid-item.fullscreen .card {
  border-radius: 0;
  border: none;
  height: 100%;
}

.contest-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10000;
  color: white;
}

.contest-over-overlay h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #f39c12, #87ceeb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contest-over-overlay p {
  font-size: 1.2rem;
}

@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "json-editor json-editor"
      "code-compiler file-upload"
      "top-contestants top-contestants";
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
  }
  .grid-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "json-editor"
      "code-compiler"
      "file-upload"
      "top-contestants";
    height: auto;
    gap: 1rem;
  }
  .grid-item {
    padding: 1rem;
    min-height: 280px;
  }
  .top-contestants-container {
    min-height: 220px;
  }
  .component-overlay p {
    font-size: 1rem;
  }
}
