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

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 10px;
}

.menu-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-button {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(145deg, #6a11cb, #2575fc);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.menu-button:hover {
    background: linear-gradient(145deg, #2575fc, #6a11cb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.menu-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.author {
    color: #ffcc00;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* Responsive design for top bar */
@media (max-width: 768px) {
    .top-bar {
        padding: 8px 15px;
        justify-content: flex-end;
    }
    
    .menu-button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .author {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 6px 10px;
        gap: 10px;
    }
    
    .menu-button {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .author {
        font-size: 0.9rem;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    padding-top: 0; /* Adjust for top bar */
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

header h1 .version {
    font-size: 1.2rem; /* Smaller than the main title */
    color: #a0a0a0; /* Different color to distinguish from main title */
    font-weight: normal; /* Lighter weight than main title */
    margin-left: 10px; /* Space from main title */
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.control-panel {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.graphics-area {
    flex: 2;
    min-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.background-controls, .force-management {
    display: flex;
    align-items: center;
    gap: 10px;
}

.background-controls label, .background-controls button, .force-management button {
    font-size: 0.9rem;
}

/* Button styling */
button {
    background: linear-gradient(145deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: linear-gradient(145deg, #2575fc, #6a11cb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

button:hover::after {
    transform: rotate(30deg) translate(20%, 20%);
}

/* Specific button styles */
#add-force {
    background: linear-gradient(145deg, #00b09b, #96c93d);
}

#add-force:hover {
    background: linear-gradient(145deg, #96c93d, #00b09b);
}

#delete-force {
    background: linear-gradient(145deg, #ff416c, #ff4b2b);
}

#delete-force:hover {
    background: linear-gradient(145deg, #ff4b2b, #ff416c);
}

#bg-color-reset {
    background: linear-gradient(145deg, #8e2de2, #4a00e0);
}

#bg-color-reset:hover {
    background: linear-gradient(145deg, #4a00e0, #8e2de2);
}

/* Button ripple effect */
button {
    position: relative;
    overflow: hidden;
    outline: none;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced input styling for better UI consistency */
input[type="range"] {
    -webkit-appearance: none;
    width: 70%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4dccff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #ffcc00;
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4dccff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#bg-color {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.canvas-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#forceCanvas {
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.explanation {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.explanation h2 {
    margin-bottom: 15px;
    color: #ffcc00;
}

.explanation p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.coordinate-system {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.coordinate-system label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.coordinate-system select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.force-controls {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.force-controls h3 {
    margin-bottom: 15px;
    color: #4dccff;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-group input[type="range"] {
    width: 70%;
    margin-right: 10px;
}

.input-group input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input-group span {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.results {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.results h3 {
    margin-bottom: 15px;
    color: #7fff00;
}

.result-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.results {
    margin-top: 0;
    padding-top: 0;
}

.results h3 {
    margin-bottom: 15px;
    color: #7fff00;
    text-align: center;
    font-size: 1.4em;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    font-size: 1.1em;
}

.result-item span:last-child {
    font-weight: bold;
    color: #ffcc00;
}

/* Responsive design */
@media (max-width: 1100px) {
  .main-content {
    flex-direction: column;
  }
  
  .control-panel, .graphics-area {
    min-width: 100%;
  }
  
  .canvas-container {
    min-height: 500px;
  }
}

/* Additional responsive styles for smaller screens */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  header h1 {
    font-size: 1.5em;
  }
  
  header h1 .version {
    font-size: 1rem; /* Smaller font size on mobile */
    display: block; /* Display on new line if needed */
    margin-top: 5px;
  }
  
  .control-panel, .graphics-area {
    padding: 15px;
  }
  
  .force-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .force-control-group {
    width: 100%;
  }
  
  .canvas-container {
    min-height: 400px;
  }
  
  canvas {
    width: 100%;
    height: auto;
    max-height: 400px;
  }
  
  .explanation {
    font-size: 0.9em;
  }
}

/* Styles for very small screens */
@media (max-width: 480px) {
  body {
    font-size: 12px;
    padding: 10px;
  }
  
  .header {
    padding: 10px;
  }
  
  .header h1 {
    font-size: 1.2em;
  }
  
  .control-panel, .graphics-area {
    padding: 10px;
  }
  
  .control-group {
    margin-bottom: 10px;
  }
  
  .canvas-container {
    min-height: 300px;
  }
  
  canvas {
    max-height: 300px;
  }
  
  .explanation {
    font-size: 0.8em;
    padding: 10px;
  }
  
  .explanation h2 {
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-group input[type="range"] {
        width: 60%;
    }
    
    .canvas-container {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .input-group input[type="range"] {
        width: 50%;
    }
    
    .canvas-container {
        min-height: 300px;
    }
    
    .input-group span {
        min-width: 30px;
        font-size: 0.9rem;
    }
}

/* Animation for smooth transitions */
input, select {
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.7);
    border-color: #ffcc00;
}