/* Основные стили плагина */
.tc-container {
    width: 100%;
    max-width: 100%;
    margin: 15px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    box-sizing: border-box;
}

.tc-form {
    margin-bottom: 15px;
}

.tc-field {
    margin-bottom: 16px;
    position: relative;
}

.tc-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
}

.tc-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #2d3748;
    font-family: inherit;
    line-height: 1.4;
}

.tc-search-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.tc-search-input::placeholder {
    color: #a0aec0;
    font-size: 13px;
}

.tc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 160px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.tc-search-result {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f7fafc;
    transition: all 0.15s ease;
    color: #2d3748;
    font-size: 13px;
    line-height: 1.3;
}

.tc-search-result:hover {
    background: #edf2f7;
    color: #2b6cb0;
}

.tc-search-result:last-child {
    border-bottom: none;
}

.tc-result {
    display: flex;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-top: 18px;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 50px;
}

.tc-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.tc-result-text {
    font-weight: 600;
    margin-right: 10px;
    position: relative;
    z-index: 2;
    font-size: 14px;
    white-space: nowrap;
}

.tc-difference {
    font-weight: 700;
    font-size: 15px;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: auto;
    white-space: nowrap;
}

.tc-copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 6px;
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.tc-copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.tc-copy-icon, .tc-copy-success {
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.tc-copy-success {
    display: none;
}

.tc-copy-btn.copied .tc-copy-icon {
    display: none;
}

.tc-copy-btn.copied .tc-copy-success {
    display: block;
}

/* Стили блока поделиться */
.tc-share {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.tc-share-title {
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
}

.tc-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.tc-share-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.tc-share-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tc-vk {
    background: linear-gradient(135deg, #4a76a8, #5b88bd);
}

.tc-tg {
    background: linear-gradient(135deg, #0088cc, #00a2e8);
}

.tc-wa {
    background: linear-gradient(135deg, #25d366, #2fe478);
}

.tc-link {
    background: linear-gradient(135deg, #718096, #a0aec0);
    z-index: 1001 !important;
    font-size: 16px !important;
}

/* Стили уведомления */
.tc-notification {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 10000;
    transition: transform 0.25s ease-in-out;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    font-size: 13px;
    max-width: 90%;
    text-align: center;
}

.tc-notification.show {
    transform: translateX(-50%) translateY(0);
}

.tc-notification-text {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* Стили для скроллбара */
.tc-search-results::-webkit-scrollbar {
    width: 4px;
}

.tc-search-results::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 2px;
}

.tc-search-results::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.tc-search-results::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Мобильная адаптивность */
@media screen and (max-width: 768px) {
    .tc-container {
        margin: 10px;
        padding: 16px;
        max-width: none;
        border-radius: 8px;
    }
    
    .tc-search-input {
        font-size: 16px !important;
        min-height: 44px;
        padding: 12px;
    }
    
    .tc-share-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tc-share-btn {
        width: 36px;
        height: 36px;
        font-size: 11px;
        z-index: 1000;
    }
    
    .tc-link {
        z-index: 1001 !important;
        font-size: 15px !important;
    }
    
    .tc-result {
        padding: 14px;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        text-align: left;
        min-height: 46px;
    }
    
    .tc-difference {
        margin-right: auto;
        margin-bottom: 0;
        font-size: 14px;
        padding: 3px 8px;
    }
    
    .tc-copy-btn {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .tc-field {
        margin-bottom: 14px;
    }
}

@media (max-width: 480px) {
    .tc-container {
        padding: 14px;
        margin: 8px;
    }
    
    .tc-field {
        margin-bottom: 12px;
    }
    
    .tc-search-input {
        padding: 11px;
        font-size: 15px !important;
    }
    
    .tc-share-buttons {
        gap: 6px;
    }
    
    .tc-share-btn {
        width: 34px;
        height: 34px;
        z-index: 1000;
    }
    
    .tc-link {
        z-index: 1001 !important;
        font-size: 14px !important;
    }
    
    .tc-notification {
        left: 15px;
        right: 15px;
        transform: translateY(-80px);
        max-width: calc(100% - 30px);
        padding: 10px 16px;
    }
    
    .tc-notification.show {
        transform: translateY(0);
    }
    
    .tc-result {
        padding: 12px;
        min-height: 44px;
    }
    
    .tc-result-text {
        font-size: 13px;
    }
    
    .tc-difference {
        font-size: 13px;
    }
}

/* Отключение увеличения на iOS */
@supports (-webkit-touch-callout: none) {
    .tc-search-input {
        font-size: 16px !important;
    }
}

/* Улучшение для мобильного ввода */
.tc-search-input:focus {
    transform: none !important;
}

/* Дополнительные исправления для мобильных устройств */
.tc-container {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.tc-search-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tc-search-results {
    animation: fadeIn 0.15s ease-out;
}

/* Компактная версия для очень маленьких экранов */
@media (max-width: 360px) {
    .tc-container {
        padding: 12px;
    }
    
    .tc-result {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }
    
    .tc-result-text {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 6px;
    }
    
    .tc-difference {
        margin-right: 0;
    }
    
    .tc-copy-btn {
        order: 3;
    }
}

/* Темная тема поддержка */
@media (prefers-color-scheme: dark) {
    .tc-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .tc-label {
        color: #e2e8f0;
    }
    
    .tc-search-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .tc-search-input::placeholder {
        color: #a0aec0;
    }
    
    .tc-search-input:focus {
        border-color: #4299e1;
        background: #4a5568;
    }
    
    .tc-search-results {
        background: #4a5568;
        border-color: #718096;
    }
    
    .tc-search-result {
        color: #e2e8f0;
        border-bottom-color: #718096;
    }
    
    .tc-search-result:hover {
        background: #5a6578;
        color: #90cdf4;
    }
    
    .tc-share {
        border-top-color: #718096;
    }
    
    .tc-share-title {
        color: #e2e8f0;
    }
}

/* Гарантия что поля не вылезают за границы */
.tc-container * {
    max-width: 100%;
}

.tc-search-input, .tc-result, .tc-share-buttons {
    width: 100%;
    box-sizing: border-box;
}