* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Tahoma, sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    padding: 20px;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.trade-container {
    margin-bottom: 30px;
}

.trade-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 20px;
}

.input-group label {
    flex: 1;
    text-align: right;
    margin-left: 10px;
}

.input-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#calculateBtn {
    background-color: #3498db;
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 20px;
    font-family: Tahoma;
}

#calculateBtn:hover {
    background-color: #2980b9;
}

.results-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-item span:first-child {
    font-weight: bold;
}

#capitalChart {
    margin-top: 30px;
    width: 100%;
}

.history {
    margin-top: 30px;
    text-align: left;
}

.history h3 {
    margin-bottom: 15px;
}

.history table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
}

.history th, .history td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.history th {
    background-color: #f2f2f2;
}

.history tr:nth-child(even) {
    background-color: #f9f9f9;
}

.win {
    color: green;
    font-weight: bold;
}

.loss {
    color: red;
    font-weight: bold;
}

.profit {
    color: green;
}

button {
    background-color: #e74c3c;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

button:hover {
    background-color: #c0392b;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
        align-items: stretch;
        padding: 0 10px;
    }
    
    .input-group label {
        text-align: center;
        margin-bottom: 5px;
    }
    
    .result-item {
        font-size: 14px;
        padding: 8px;
    }
}