/* Full solving.css - Combined original styles + restored button styles */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Theme variables */
:root {
  --primary-bg: #0f172a;
  --secondary-bg: #1a2847;
  --tertiary-bg: #243658;
  --primary-text: #e2e8f0;
  --secondary-text: #cbd5e1;
  --accent-cyan: #00d9ff;
  --accent-green: #00ff88;
  --accent-red: #ff4444;
  --accent-yellow: #ffaa00;
  --border-color: #334155;
}

/* Base */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #131a2f;
  color: var(--primary-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.header {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(26, 40, 71, 0.95) 100%);
  border-bottom: 1px solid rgba(0,229,255,0.9);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}
.logo img {
  width: 160px;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--secondary-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: var(--accent-cyan);
}
.sign-in-btn {
  background-color: #1a2847;
  color: #a8ff60;
  border: 1px solid #a8ff60;
  padding: 0.5rem 1.5rem;
  border-radius: 9px;
  cursor: pointer;
  height: 42px;
  transition: all 0.3s;
  font-weight: 900;
}

.sign-in-btn:hover {
  background: #00d9ff;
  color: #0f172a;
}

/* Main Container */
.solve-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  height: calc(100vh - 70px);
}

.problem-panel,
.editor-panel {
  background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
  border: 1px solid rgba(0,229,255,0.9);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Problem Panel */
.problem-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.problem-header h2 {
  font-size: 1.5rem;
  color: var(--primary-text);
}

.problem-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.difficulty {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.difficulty.easy {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
}

.difficulty.medium {
  background: rgba(255, 170, 0, 0.2);
  color: var(--accent-yellow);
}

.difficulty.hard {
  background: rgba(255, 68, 68, 0.2);
  color: var(--accent-red);
}

.acceptance {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

/* Tabs */
.problem-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  gap: 2rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  padding: 1rem 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--accent-cyan);
}

.tab-btn.active {
  color: var(--accent-cyan);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
}

/* Problem Content */
.problem-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.tab-content h4 {
  color: var(--primary-text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.tab-content p {
  color: var(--secondary-text);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.tab-content ul {
  margin-left: 1.5rem;
  color: var(--secondary-text);
}

.tab-content li {
  margin-bottom: 0.5rem;
}

.example {
  background: rgba(0, 217, 255, 0.1);
  border-left: 3px solid var(--accent-cyan);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.example p {
  margin-bottom: 0.5rem;
  font-family: "Courier New", monospace;
  color: var(--accent-cyan);
}

/* Editor Panel */
.editor-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.language-selector select {
  background: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-selector select:hover {
  border-color: var(--accent-cyan);
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

/* Primary action buttons (Run / Submit) - base */
.btn-run,
.btn-submit {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

/* Run button (outline style) */
.btn-run {
  background: rgba(0, 217, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.btn-run:hover {
  background: rgba(0, 217, 255, 0.3);
  transform: translateY(-2px);
}

/* Submit button (primary gradient) */
.btn-submit {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  color: var(--primary-bg);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

/* Code Editor */
.code-editor-wrapper {
  display: flex;
  flex: 1;
  background: var(--primary-bg);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.line-numbers {
  width: 50px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border-color);
  padding: 1rem 0;
  text-align: right;
  color: #00d9ff;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow: hidden;
}

.code-editor {
  flex: 1;
  background: transparent;
  color: rgb(232, 232, 232);
  border: none;
  padding: 1rem;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  tab-size: 4;
}

.code-editor::selection {
  background: rgba(0, 217, 255, 0.3);
}

/* Test Cases Section */
.testcases-section {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.testcases-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.testcases-header h3 {
  color: var(--accent-cyan);
  font-size: 1rem;
}

/* Add Test base */
.btn-add-test {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-add-test:hover {
  background: rgba(0, 255, 136, 0.3);
}

.testcases-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.testcase-item {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.testcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.testcase-num {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Delete base (square) */
.delete-test {
  background: rgba(255, 68, 68, 0.2);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-test:hover {
  background: rgba(255, 68, 68, 0.3);
}

.testcase-input,
.testcase-output {
  margin-bottom: 0.75rem;
}

.testcase-input label,
.testcase-output label {
  display: block;
  color: var(--secondary-text);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.test-input,
.test-output {
  width: 100%;
  background: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
}

/* Run test base */
.btn-run-test {
  width: 100%;
  background: rgba(0, 217, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.btn-run-test:hover {
  background: rgba(0, 217, 255, 0.3);
}

/* Testcase result hidden by default */
.testcase-result {
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--secondary-text);
  display: none;
}

/* Passed / Failed styles */
.testcase-result.passed {
  display: block;
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  border-left: 3px solid var(--accent-green);
  padding-left: 0.75rem;
}

.testcase-result.failed {
  display: block;
  background: rgba(255, 68, 68, 0.1);
  color: var(--accent-red);
  border-left: 3px solid var(--accent-red);
  padding-left: 0.75rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 16px 48px rgba(0, 217, 255, 0.2);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--secondary-text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 2rem 1.5rem;
  text-align: center;
}

.modal-body p {
  color: var(--secondary-text);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat {
  background: var(--tertiary-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.stat-label {
  display: block;
  color: var(--secondary-text);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  display: block;
  color: var(--accent-green);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.btn-continue {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  color: var(--primary-bg);
  padding: 0.8rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-continue:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Footer */
.footer {
  background: linear-gradient(90deg, #0f172a 0%, #1a2847 100%);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  padding: 3rem 2rem 1rem;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: #00d9ff;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.footer-section a {
  display: block;
  color: #a0a0a0;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #00d9ff;
}

.footer-bottom {
  text-align: left;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  color: #707070;
  font-size: 0.9rem;
}
.footer-bottom .footer-links a {
  color: #707070;
  text-decoration: none;
  padding: 0.2%;
}
.header-rit {
  display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .solve-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .problem-panel,
  .editor-panel {
    min-height: 50vh;
  }
}

@media (max-width: 768px) {
  .solve-container {
    padding: 1rem;
    gap: 1rem;
  }

  .header-container {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  .header-right {
    display: none;
  }
  .nav {
    display: none;
  }
  .header-rit {
    display: block;
    border-radius: 2px solid red;
  }

  .sign-in-btn {
    background-color: #1a2847;
    color: #ff0a0a;
    border: 1px solid #ec2b11;
    padding: 0.5rem 1.5rem;
    border-radius: 9px;
    cursor: pointer;
    height: 42px;
    transition: all 0.3s;
    font-weight: 900;
  }

  .nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .problem-header {
    flex-direction: column;
    gap: 1rem;
  }

  .problem-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .editor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-actions {
    width: 100%;
  }

  .btn-run,
  .btn-submit {
    flex: 1;
  }

  .modal-stats {
    grid-template-columns: 1fr;
  }
}

/* ===== Restorative / Override Styles =====
   These are more specific so they take precedence over earlier rules.
   They restore compact circular delete and consistent Run/Submit/add/run-test appearances.
*/

/* Grouped primary action buttons (Run / Submit) */
.editor-header .btn-run,
.editor-header .btn-submit {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, opacity .08s ease;
  box-shadow: none;
}

/* Run button (outline) */
.editor-header .btn-run {
  background: linear-gradient(180deg, rgba(0,217,255,0.14) 0%, rgba(0,217,255,0.10) 100%);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,217,255,0.18);
}

/* Submit button (primary) */
.editor-header .btn-submit {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  color: var(--primary-bg);
  border: none;
}

/* Small run-on-test buttons inside each testcase */
.testcase-item .btn-run-test {
  padding: 8px;
  border-radius: 6px;
  width: 100%;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0,217,255,0.12);
  background: rgba(0,217,255,0.12);
  color: var(--accent-cyan);
  cursor: pointer;
  box-shadow: none;
}

/* Add Test button (secondary) */
.testcases-header .btn-add-test {
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0,255,136,0.12);
  background: rgba(0,255,136,0.06);
  color: var(--accent-green);
  cursor: pointer;
}

/* Delete (×) button — small circular */
.testcase-item .delete-test {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--secondary-text);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, color .12s ease;
}

/* delete hover: subtle destructive tone */
.testcase-item .delete-test:hover {
  background: rgba(255,68,68,0.10);
  color: var(--accent-red);
  transform: translateY(-1px);
}

/* Modal close button — circular, small, neutral hover */
.modal .modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--secondary-text);
  font-size: 16px;
  cursor: pointer;
}
.modal .modal-close:hover {
  background: rgba(255,255,255,0.03);
  color: var(--accent-red);
  transform: translateY(-1px);
}

/* Focus outlines for accessibility */
.editor-header .btn-run:focus,
.editor-header .btn-submit:focus,
.testcase-item .btn-run-test:focus,
.testcase-item .delete-test:focus,
.modal .modal-close:focus,
.testcases-header .btn-add-test:focus {
  outline: 3px solid rgba(0,200,180,0.14);
  outline-offset: 2px;
}

/* Small visual tweaks to ensure results area spacing */
.testcase-result { margin-top: 8px; font-size: 13px; }
