:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --text-color: #4a4a4a;
    --bg-color: #f7f9fc;
    --card-bg-color: #ffffff;
    --border-color: #e6e9f0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.calculator-container {
    background: var(--card-bg-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 30, 80, 0.1);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.header {
    background: var(--primary-color);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.header p {
    margin: 5px 0 0;
    font-weight: 400;
    opacity: 0.9;
    font-size: 0.9rem;
}

.edit-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.edit-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.input-section {
    padding: 25px 30px;
    background-color: rgba(74, 144, 226, 0.05);
}

.input-section label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 15px;
}

.input-wrapper span {
    font-size: 1.5rem;
    font-weight: 600;
    color: #9b9b9b;
    margin-right: 10px;
}

input[type="number"] {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    padding: 10px 0;
}

input[type="number"]::placeholder {
    color: #cdd3dc;
}
/* Hide spin buttons on number input */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

.calculator-container.edit-mode .concept,
.calculator-container.edit-mode .rate {
    background-color: #e8f0fe;
    padding: 2px 5px;
    border-radius: 4px;
    outline: 1px solid var(--primary-color);
    cursor: text;
}

.results-section {
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease-in-out;
}

.result-item:last-child {
    border-bottom: 1px solid var(--border-color);
}

.result-item:hover {
    border-color: var(--primary-color);
    background-color: #f7f9fc;
}

.result-item.selected {
    border-color: var(--primary-color);
    background-color: #e8f0fe;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.result-item .percentage {
    font-size: 1rem;
    font-weight: 400;
}

.result-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.total-section {
    background-color: #f7f9fc;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

.total-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.total-item span:last-child {
    font-weight: 600;
}

.total-section hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 15px 0;
}

.total-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.total-final span:last-child {
    color: var(--secondary-color);
    font-size: 1.75rem;
}

.extra-section {
    padding: 20px 30px;
    background-color: #f7f9fc;
    border-top: 1px solid var(--border-color);
}

.conditions-section label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
    color: var(--text-color);
}

#agreementConditions {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    background-color: #fff;
    transition: border-color 0.3s ease;
    min-height: 80px;
}

#agreementConditions:focus {
    border-color: var(--primary-color);
}

.actions-section {
    margin-top: 20px;
}

#share-btn {
    width: 100%;
    background-color: #25D366;
    color: white;
    border: none;
    padding: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#share-btn:hover {
    background-color: #1ebe57;
}

#share-btn svg {
    width: 20px;
    height: 20px;
}