/* ================= Enhanced Base Styles ================= */
:root {
    --primary-color: rgba(0, 122, 255, 0.9);
    --primary-dark: rgba(0, 84, 180, 0.9);
    --secondary-color: #2c3e50;
    --accent-color: rgba(64, 156, 255, 0.9);
    --light-bg: #f0f4f8;
    --white: #ffffff;
    --text-color: #2d3748;
    --border-color: #e0e6ed;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  
  body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f4f8 0%, #e6eef7 100%);
    color: var(--text-color);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
  }
  
  /* ================= Enhanced Navbar ================= */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    height: 4rem;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
  }
  
  .logo {
    display: flex;
    align-items: center;
    height: 100%;
    transition: transform 0.3s ease;
  }
  
  .logo:hover {
    transform: scale(1.03);
  }
  
  .logo a img {
    height: 4rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 2%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
  }
  
  .nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
  }
  
  .nav-links a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    display: block;
  }
  
  .nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease;
  }
  
  .nav-links a:hover::after {
    width: 100%;
  }
  
  .nav-links a:hover {
    color: #dbeafe;
  }
  
  /* Hamburger Menu */
  .hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 20;
  }
  
  .hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  
  /* Mobile Navigation */
  @media (max-width: 768px) {
    .navbar {
      padding: 0 1.5rem;
    }
    
    .logo a img {
      height: 3.5rem;
    }
    
    .hamburger {
      display: flex;
    }
    
    .nav-links {
      position: fixed;
      top: 0;
      right: -100%;
      width: 250px;
      height: 100vh;
      background: var(--primary-dark);
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-start;
      padding-top: 5rem;
      padding-left: 2rem;
      transition: 0.3s ease-in-out;
      box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
      z-index: 10;
      gap: 2rem;
    }
    
    .nav-links.active {
      right: 0;
    }
    
    .nav-links li {
      width: 100%;
    }
    
    .nav-links a {
      font-size: 1.1rem;
      width: 100%;
      display: block;
      padding: 0.7rem 0;
    }
    
    .hamburger.active span:nth-child(1) {
      transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
      opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
      transform: translateY(-9px) rotate(-45deg);
    }
  }
  
  /* Tablet Navigation Adjustments */
  @media (min-width: 769px) and (max-width: 1024px) {
    .navbar {
      padding: 0 1.75rem;
    }
    
    .nav-links {
      gap: 1.25rem;
    }
    
    .nav-links a {
      font-size: 0.95rem;
    }
  }
  
  /* Small screens */
  @media (max-width: 480px) {
    .navbar {
      padding: 0 1rem;
    }
    
    .logo a img {
      height: 3rem;
    }
  }
  
  /* ================= Enhanced Content Layout ================= */
  .content {
    display: flex;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem;
  }
  
  .tabs-and-content {
    flex: 3;
    display: flex;
    flex-direction: column;
    margin-right: 2rem;
  }
  
  /* ================= Responsive Design ================= */
  @media (max-width: 1024px) {
    .content {
      flex-direction: column;
      padding: 1.5rem;
    }
  
    .tabs-and-content {
      margin-right: 0;
      margin-bottom: 2rem;
    }
  }
  
  @media (max-width: 768px) {
    .tabs button {
      padding: 0.8rem 1.2rem;
      font-size: 0.9rem;
    }
  
    .actions-container > div:first-child {
      flex-direction: column;
    }
  
    #run-btn, #test-btn, #submit-btn {
      width: 100%;
    }
  }
  
  /* ================= Enhanced Tabs ================= */
  .tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .tabs button {
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
    position: relative;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .tabs button.active {
    color: #4e41fb;
  }
  
  .tabs button.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  }
  
  .tabs button:hover:not(.active) {
    background-color: rgba(0, 122, 255, 0.1);
  }
  
  /* Responsive tabs */
  @media (max-width: 768px) {
    .tabs {
      margin-bottom: 1.5rem;
    }
    
    .tabs button {
      padding: 0.8rem 1rem;
      font-size: 0.9rem;
      min-width: 90px;
    }
  }
  
  @media (max-width: 480px) {
    .tabs {
      margin-bottom: 1rem;
    }
    
    .tabs button {
      padding: 0.7rem 0.5rem;
      font-size: 0.85rem;
      min-width: 80px;
    }
  }
  
  /* ================= Enhanced Tab Content ================= */
  .tab-content {
    background-color: var(--white);
    box-shadow: 0 6px 20px rgba(91, 155, 213, 0.15);
    padding: 2rem;
    flex-grow: 1;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow-x: hidden;
  }
  
  @media (max-width: 768px) {
    .tab-content {
      padding: 1.5rem;
    }
    
    .statement-content h2,
    .submissions-content h2,
    .solution-content h2 {
      font-size: 1.5rem;
      margin-top: 0;
    }
    
    .statement-content h3 {
      font-size: 1.2rem;
    }
  }
  
  @media (max-width: 480px) {
    .tab-content {
      padding: 1rem;
    }
    
    .statement-content h2,
    .submissions-content h2,
    .solution-content h2 {
      font-size: 1.3rem;
    }
  }
  
  .statement-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }
  
  /* ================= Enhanced Code Editor ================= */
  .code-editor {
    flex: 2;
    display: flex;
    flex-direction: column;
  }
  
  .code-editor-container {
    position: relative;
    height: 400px;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }
  
  #code-editor {
    width: 100%;
    height: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-family: 'Fira Code', 'Consolas', monospace;
    background: #282c34;
    color: #abb2bf;
    line-height: 1.5;
    tab-size: 4;
    transition: var(--transition);
  }
  
  #code-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
  }
  
  /* ================= Enhanced Button Group ================= */
  .actions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .actions-container > div:first-child {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
  }
  
  #run-btn, #test-btn, #submit-btn {
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    color: white;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 3px 8px rgba(0, 84, 180, 0.3);
  }
  
  #run-btn {
    background: var(--primary-color);
  }
  
  #run-btn:hover {
    background: var(--primary-dark);
  }
  
  #test-btn {
    background: var(--accent-color);
  }
  
  #test-btn:hover {
    background: var(--primary-color);
  }
  
  #submit-btn {
    background: var(--primary-dark);
  }
  
  #submit-btn:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
  }
  
  /* ================= Enhanced Custom Input ================= */
  #custom-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--white);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
  }
  
  #custom-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
  }
  
  /* ================= Enhanced Language Selector ================= */
  .language-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
  }
  
  #language-select {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    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='currentColor' 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: 1rem;
  }
  
  #language-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
  }
  
  /* ================= Enhanced Result Container ================= */
  #result-container {
    margin-top: 1.5rem;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }
  
  .result-title {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  #result-output {
    font-family: 'Fira Code', 'Consolas', monospace;
    white-space: pre-wrap;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
  }
  
  .success {
    color: var(--success-color);
  }
  
  .error {
    color: var(--error-color);
  }
  
  /* ================= Enhanced Submissions Table ================= */
  .submissions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
  }
  
  .submissions-table th, 
  .submissions-table td {
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    text-align: left;
  }
  
  .submissions-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
  }
  
  .submissions-table tr:nth-child(even) {
    background-color: #f8f9fa;
  }
  
  .submissions-table tr:hover {
    background-color: #e9ecef;
  }
  
  /* ================= Enhanced Test Cases ================= */
  .test-case {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
  }
  
  .test-case:hover {
    box-shadow: var(--shadow-md);
  }
  
  .test-case.pass {
    border-left: 4px solid var(--success-color);
    background-color: rgba(40, 167, 69, 0.05);
  }
  
  .test-case.fail {
    border-left: 4px solid var(--error-color);
    background-color: rgba(220, 53, 69, 0.05);
  }
  
  .test-case-header {
    font-weight: bold;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* ================= Animations ================= */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .tab-content {
    animation: fadeIn 0.4s ease-out;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  #run-btn:active, #test-btn:active, #submit-btn:active {
    animation: pulse 0.2s ease;
  }