/* NTWC Number to Words Currency Styles */
.ntwc-container {
    width: 100%;
    max-width: 100%;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ntwc-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.ntwc-input {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    text-align: center;
    background: white;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    /* Предотвращение увеличения масштаба на мобильных устройствах */
    font-size: 16px !important;
    max-height: none !important;
}

.ntwc-input:focus {
    border-color: #4CAF50;
    outline: none;
    /* Предотвращение увеличения масштаба на iOS */
    transform: scale(1);
}

.ntwc-select {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    background: white;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    /* Предотвращение увеличения масштаба на мобильных устройствах */
    font-size: 16px !important;
    max-height: none !important;
}

.ntwc-select:focus {
    border-color: #4CAF50;
    outline: none;
    /* Предотвращение увеличения масштаба на iOS */
    transform: scale(1);
}

.ntwc-result-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.ntwc-result {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    flex: 1;
    line-height: 1.4;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 10px;
    word-break: break-word;
}

.ntwc-copy-result {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Предотвращение увеличения масштаба на мобильных устройствах */
    font-size: 16px !important;
}

.ntwc-copy-result:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.ntwc-copy-result:active {
    transform: scale(0.95);
}

.ntwc-share {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ntwc-share-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    color: white;
    position: relative;
    z-index: 1;
    /* Предотвращение увеличения масштаба на мобильных устройствах */
    font-size: 18px !important;
}

.ntwc-share-vk {
    background: #4C75A3;
}

.ntwc-share-tg {
    background: #0088cc;
}

.ntwc-share-wa {
    background: #25D366;
}

.ntwc-share-copy {
    background: #666;
}

.ntwc-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.ntwc-share-btn:active {
    transform: scale(0.95);
}

.ntwc-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    background: #4CAF50;
    color: white;
    padding: 25px 35px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: ntwc-fade-in-out 3s ease-in-out forwards;
}

@keyframes ntwc-fade-in-out {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* Улучшение доступности */
.ntwc-share-btn:focus,
.ntwc-copy-result:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.ntwc-input:focus,
.ntwc-select:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Стили для состояния загрузки */
.ntwc-result-container.loading {
    opacity: 0.7;
}

.ntwc-result-container.loading .ntwc-result::after {
    content: '...';
    animation: ntwc-loading-dots 1.5s infinite;
}

@keyframes ntwc-loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Desktop */
@media (max-width: 1024px) {
    .ntwc-input-group {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .ntwc-container {
        padding: 15px;
    }
    
    .ntwc-input-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ntwc-result-container {
        padding: 12px;
        flex-direction: column;
    }
    
    .ntwc-result {
        padding-right: 0;
        padding-bottom: 10px;
        font-size: 16px;
        text-align: center;
    }
    
    .ntwc-copy-result {
        align-self: stretch;
        padding: 8px 15px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .ntwc-container {
        padding: 10px;
    }
    
    .ntwc-input, .ntwc-select {
        padding: 12px 15px; /* Увеличиваем padding для лучшего touch */
        font-size: 16px; /* Фиксируем размер шрифта */
    }
    
    .ntwc-result {
        font-size: 16px; /* Немного уменьшаем для мобильных */
        min-height: 50px;
    }
    
    .ntwc-share-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .ntwc-copy-result {
        padding: 10px 12px;
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .ntwc-share {
        gap: 10px;
    }
    
    .ntwc-share-btn {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    .ntwc-result-container {
        padding: 10px;
    }
}

/* Предотвращение увеличения масштаба на всех мобильных устройствах */
@media screen and (max-width: 768px) {
    .ntwc-input,
    .ntwc-select,
    .ntwc-copy-result,
    .ntwc-share-btn {
        font-size: 16px !important;
        touch-action: manipulation;
    }
    
    .ntwc-container {
        /* Создаем новый контекст stacking для изоляции трансформаций */
        transform: translateZ(0);
    }
}