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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.content {
    padding: 30px;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    width: 100%;
}

label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 16px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: linear-gradient(45deg, #51cf66, #40c057);
}

.results {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.result-display {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #51cf66;
    margin-bottom: 20px;
}

.result-display p {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.checkmark {
    color: #51cf66;
    font-weight: bold;
    font-size: 20px;
}

.dp-table {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

th, td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 14px;
}

th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.selected {
    background: #51cf66 !important;
    color: white;
    font-weight: bold;
}

.knapsack-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.item {
    padding: 15px 10px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    background: #6c757d;
    font-size: 14px;
}

.selected-item {
    animation: pulse 1s infinite;
    box-shadow: 0 0 20px rgba(81, 207, 102, 0.5);
    background: #51cf66 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
