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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 480px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.language-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.input-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e4e8;
    background: white;
    color: #586069;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: #f6f8fa;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

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

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #24292e;
    font-size: 14px;
}

.input-with-currency {
    display: flex;
    align-items: center;
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    color: #586069;
    font-size: 18px;
    font-weight: 500;
}

.input-with-currency input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    font-size: 18px;
    transition: border-color 0.3s ease;
}

.input-with-currency input:focus {
    outline: none;
    border-color: #667eea;
}

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

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

.tip-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.tip-btn {
    padding: 12px;
    border: 2px solid #e1e4e8;
    background: white;
    color: #586069;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tip-btn:hover {
    background: #f6f8fa;
    transform: translateY(-2px);
}

.tip-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.custom-tip {
    grid-column: span 5;
    padding: 12px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.custom-tip:focus {
    outline: none;
    border-color: #667eea;
}

.people-counter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.counter-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e1e4e8;
    background: white;
    color: #586069;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
}

#peopleCount {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
}

#peopleCount:focus {
    outline: none;
    border-color: #667eea;
}

.rounding-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.rounding-btn {
    padding: 12px;
    border: 2px solid #e1e4e8;
    background: white;
    color: #586069;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rounding-btn:hover {
    background: #f6f8fa;
    transform: translateY(-2px);
}

.rounding-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.individual-inputs {
    margin-bottom: 25px;
}

.individual-inputs h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #24292e;
}

.person-input {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.person-name {
    padding: 12px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    font-size: 14px;
}

.person-name:focus {
    outline: none;
    border-color: #667eea;
}

.remove-person-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e1e4e8;
    background: white;
    color: #d73a49;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-person-btn:hover {
    background: #d73a49;
    color: white;
    border-color: #d73a49;
    transform: rotate(90deg);
}

.add-person-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e1e4e8;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-person-btn:hover {
    background: #f6f8fa;
    border-color: #667eea;
}

.results {
    background: #f6f8fa;
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 16px;
}

.result-item.total {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.result-item.per-person {
    font-size: 18px;
    font-weight: 600;
    color: #24292e;
}

.result-item.individual-result {
    font-size: 15px;
    color: #586069;
    border-bottom: 1px solid #e1e4e8;
}

.result-item.individual-result:last-child {
    border-bottom: none;
}

.divider {
    height: 2px;
    background: #e1e4e8;
    margin: 15px 0;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.reset-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: #586069;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #f6f8fa;
    border-color: #d73a49;
    color: #d73a49;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .card {
        padding: 20px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    .tip-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .custom-tip {
        grid-column: span 3;
    }
    
    .rounding-selector {
        grid-template-columns: 1fr;
    }
    
    .person-input {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .person-name,
    .input-with-currency,
    .remove-person-btn {
        width: 100%;
    }
}