/* Контейнер */
.hmpn-container {
    width: 100%;
    max-width: 100%;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Поля ввода */
.hmpn-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    background: white;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.hmpn-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.hmpn-main-inputs {
    margin-bottom: 15px;
}

.hmpn-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.hmpn-total-percent {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
    padding: 0 15px;
    text-align: center;
}

/* Секция остатка */
.hmpn-remaining-section {
    margin-bottom: 15px;
}

.hmpn-remaining {
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    background: white;
    border: 2px solid #e0e0e0;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hmpn-remaining.negative {
    border-color: #f44336;
    background: #ffebee;
    color: #f44336;
}

.hmpn-remaining-text {
    color: #666;
}

.hmpn-remaining-value {
    color: #4CAF50;
    font-weight: bold;
    font-size: 18px;
}

.hmpn-remaining-percent {
    color: #2196F3;
    font-weight: bold;
    font-size: 16px;
}

.hmpn-remaining.negative .hmpn-remaining-value,
.hmpn-remaining.negative .hmpn-remaining-percent {
    color: #f44336;
}

/* Кнопки */
.hmpn-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 12px 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.hmpn-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.hmpn-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.hmpn-add-btn {
    margin-bottom: 15px;
}

.hmpn-save-btn {
    background: #2196F3;
    margin-bottom: 20px;
}

.hmpn-save-btn:hover {
    background: #0b7dda;
}

.hmpn-plus-icon {
    font-size: 20px;
    font-weight: bold;
}

/* Дополнительные числа */
.hmpn-extra-numbers {
    margin-bottom: 15px;
}

.hmpn-extra-number-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 10px;
    align-items: center;
    transition: all 0.3s;
}

.hmpn-extra-number-item:hover {
    border-color: #4CAF50;
}

.hmpn-extra-name {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    text-align: center;
}

.hmpn-extra-value {
    margin-bottom: 0;
    text-align: center;
}

.hmpn-percent-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hmpn-extra-percent {
    width: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    font-size: 14px;
}

.hmpn-percent-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
}

.hmpn-percent-btn:hover {
    background: #e0e0e0;
}

.hmpn-remove-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.hmpn-remove-btn:hover {
    background: #da190b;
    transform: scale(1.05);
}

/* Сохраненные результаты */
.hmpn-results-section {
    margin-bottom: 20px;
}

.hmpn-results-title, .hmpn-share-title {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

.hmpn-saved-results {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.hmpn-saved-result-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.hmpn-saved-result-item:hover {
    background: #f9f9f9;
}

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

.hmpn-result-info {
    flex: 1;
}

.hmpn-result-main {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.hmpn-result-details {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.hmpn-result-date {
    font-size: 11px;
    color: #999;
}

.hmpn-result-actions {
    display: flex;
    gap: 8px;
}

.hmpn-restore-btn, .hmpn-delete-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.hmpn-restore-btn {
    background: #2196F3;
    color: white;
}

.hmpn-restore-btn:hover {
    background: #0b7dda;
}

.hmpn-delete-btn {
    background: #f44336;
    color: white;
}

.hmpn-delete-btn:hover {
    background: #da190b;
}

.hmpn-no-results {
    text-align: center;
    color: #666;
    padding: 30px 20px;
    font-style: italic;
}

/* Кнопки поделиться */
.hmpn-share-section {
    margin-bottom: 10px;
}

.hmpn-share-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hmpn-share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
    font-size: 14px;
}

.hmpn-share-btn:hover {
    transform: scale(1.1);
}

.hmpn-vk { background: #4C75A3; }
.hmpn-tg { background: #0088cc; }
.hmpn-wa { background: #25D366; }
.hmpn-copy { background: #666; }

/* Уведомления */
.hmpn-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    background: #4CAF50;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    font-weight: bold;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    animation: hmpn-fadeInOut 3s ease-in-out;
}

@keyframes hmpn-fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Адаптивность */

/* Desktop */
@media (max-width: 1024px) {
    .hmpn-container {
        padding: 15px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .hmpn-extra-number-item {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .hmpn-percent-controls {
        justify-content: center;
    }
    
    .hmpn-saved-result-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .hmpn-result-actions {
        width: 100%;
        justify-content: center;
    }
    
    .hmpn-share-buttons {
        gap: 6px;
    }
    
    .hmpn-share-btn {
        width: 45px;
        height: 45px;
    }
    
    .hmpn-remaining {
        flex-direction: column;
        gap: 5px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .hmpn-input-group {
        grid-template-columns: 1fr;
    }
    
    .hmpn-total-percent {
        padding: 10px 0;
    }
    
    .hmpn-container {
        padding: 10px;
    }
    
    .hmpn-share-buttons {
        gap: 4px;
    }
    
    .hmpn-share-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .hmpn-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .hmpn-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .hmpn-share-buttons {
        gap: 3px;
    }
    
    .hmpn-share-btn {
        width: 35px;
        height: 35px;
        font-size: 11px;
    }
    
    .hmpn-extra-number-item {
        padding: 10px;
    }
}