/* Physics Simulation Styles */

main {
    padding: 2rem 1rem;
}

.tutorial {
    background: rgba(79, 124, 255, 0.08);
    border: 1px solid rgba(79, 124, 255, 0.2);
    border-radius: 8px;
    padding: 24px;
    margin: 0 auto 32px auto;
    max-width: 800px;
}

.tutorial h2 {
    color: #4f7cff;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.tutorial p {
    margin: 12px 0;
    line-height: 1.6;
    color: #d1d1d8;
}

.tutorial ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}

.tutorial li {
    margin: 12px 0;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
    color: #d1d1d8;
}

.tutorial li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #4f7cff;
    font-weight: bold;
}

.tutorial strong {
    color: #e8e8ec;
    font-weight: 600;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.canvas-wrapper {
    background: rgba(20, 5, 40, 0.8);
    border: 2px solid rgba(206, 147, 216, 0.4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

#simCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

.control-panel {
    background: rgba(74, 20, 140, 0.3);
    border: 1px solid rgba(206, 147, 216, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    padding: 1rem;
    background: rgba(74, 20, 140, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(206, 147, 216, 0.25);
}

.control-group h3 {
    color: #ce93d8;
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group p {
    color: #e1bee7;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.button-group .btn {
    padding: 0.5rem;
    font-size: 0.85rem;
}

.btn {
    padding: 0.7rem 1.2rem;
    background: #7b1fa2;
    color: #fff;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn:hover {
    background: #9c27b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-reset {
    grid-column: 1 / -1;
}

.btn-spawn {
    width: 100%;
    margin-top: 0.5rem;
}

.speed-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.speed-btn {
    padding: 0.5rem;
    background: rgba(206, 147, 216, 0.15);
    color: #e1bee7;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.speed-btn:hover {
    background: rgba(206, 147, 216, 0.3);
    border-color: rgba(206, 147, 216, 0.6);
    transform: translateY(-1px);
}

.speed-btn.active {
    background: #7b1fa2;
    color: #fff;
    border-color: #ce93d8;
    box-shadow: 0 0 10px rgba(206, 147, 216, 0.5);
}

.reset-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(206, 147, 216, 0.15);
    color: #e1bee7;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 0.5rem;
}

.reset-btn:hover {
    background: rgba(206, 147, 216, 0.3);
    border-color: rgba(206, 147, 216, 0.6);
    transform: translateY(-1px);
}

.reset-btn:active {
    transform: translateY(0);
}

.control-group label {
    display: block;
    color: #e1bee7;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-control {
    margin-bottom: 0.75rem;
}

.input-control > label {
    margin-bottom: 0.3rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-btn {
    padding: 0.4rem 0.6rem;
    background: rgba(206, 147, 216, 0.2);
    color: #e1bee7;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
    min-width: 36px;
}

.input-btn:hover {
    background: rgba(206, 147, 216, 0.35);
    border-color: rgba(206, 147, 216, 0.6);
}

.input-btn:active {
    transform: scale(0.95);
}

.control-group input[type="number"] {
    padding: 0.5rem 0.75rem;
    background: rgba(206, 147, 216, 0.1);
    color: #ffffff;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 100px;
}

.control-group input[type="number"]:hover {
    background: rgba(206, 147, 216, 0.2);
    border-color: rgba(206, 147, 216, 0.6);
}

.control-group input[type="number"]:focus {
    outline: none;
    background: rgba(206, 147, 216, 0.25);
    border-color: #ce93d8;
    box-shadow: 0 0 8px rgba(206, 147, 216, 0.4);
}

.control-group input[type="number"]::-webkit-outer-spin-button,
.control-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.control-group input[type="number"] {
    -moz-appearance: textfield;
}

.control-group select {
    padding: 0.5rem 0.75rem;
    background: rgba(206, 147, 216, 0.1);
    color: #ffffff;
    border: 1px solid rgba(206, 147, 216, 0.4);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    cursor: pointer;
}

.control-group select:hover {
    background: rgba(206, 147, 216, 0.2);
    border-color: rgba(206, 147, 216, 0.6);
}

.control-group select:focus {
    outline: none;
    background: rgba(206, 147, 216, 0.25);
    border-color: #ce93d8;
    box-shadow: 0 0 8px rgba(206, 147, 216, 0.4);
}

.control-group select option {
    background: #140528;
    color: #ffffff;
}

.hint {
    font-size: 0.8rem;
    color: #b39ddb;
    font-style: italic;
    margin: 0.5rem 0 0 0;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }

    .control-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-height: none;
    }

    .canvas-wrapper {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .control-panel {
        grid-template-columns: 1fr;
    }

    .button-group {
        grid-template-columns: 1fr;
    }
}
