/* Контейнер */
.qrg-container {
    width: 100%;
    max-width: 1200px;
    background: #f5f5f5;
    border-radius: 15px;
    padding: 25px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0 auto;
}

/* Табы */
.qrg-tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.qrg-tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.qrg-tab.active {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.qrg-tab-content {
    display: none;
}

.qrg-tab-content.active {
    display: block;
}

/* Содержимое */
.qrg-content-fields {
    margin-top: 20px;
}

.qrg-content-field {
    display: none;
}

.qrg-content-field.active {
    display: block;
}

.qrg-input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.qrg-input-col {
    display: flex;
    flex-direction: column;
}

/* Дизайн */
.qrg-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.qrg-setting-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Пресеты */
.qrg-presets {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.qrg-presets-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.qrg-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.qrg-preset-btn {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.qrg-preset-btn:hover {
    border-color: #4CAF50;
    background: #f8fff8;
}

/* Секция логотипов */
.qrg-logo-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.qrg-logo-type-selector {
    margin-bottom: 20px;
}

.qrg-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.qrg-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.qrg-radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.qrg-radio-label input[type="radio"] {
    display: none;
}

.qrg-radio-label input[type="radio"]:checked + .qrg-radio-custom {
    border-color: #4CAF50;
}

.qrg-radio-label input[type="radio"]:checked + .qrg-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Предустановленные логотипы */
.qrg-preset-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.qrg-preset-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.qrg-preset-logo:hover {
    border-color: #4CAF50;
    background: #f8fff8;
}

.qrg-preset-logo.active {
    border-color: #4CAF50;
    background: #e8f5e8;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.qrg-preset-logo img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    object-fit: contain;
}

.qrg-preset-logo span {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Кастомный логотип */
.qrg-custom-logo {
    margin-top: 20px;
}

.qrg-logo-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.qrg-logo-filename {
    color: #666;
    font-size: 14px;
}

.qrg-logo-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
}

.qrg-logo-image {
    max-width: 300px;
    max-height: 300px;
    margin-bottom: 15px;
}

.qrg-logo-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Range inputs */
.qrg-range {
    width: 100%;
    margin: 10px 0;
}

.qrg-range-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: #333;
}

/* Секция подписи */
.qrg-caption-settings {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.qrg-caption-fields {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.qrg-input-suffix {
    margin-left: 5px;
    color: #666;
    font-size: 14px;
}

/* Подписи в QR-коде */
.qrg-caption-top,
.qrg-caption-bottom {
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
    font-family: inherit;
}

.qrg-caption-top {
    margin-bottom: 15px;
}

.qrg-caption-bottom {
    margin-top: 15px;
}

/* Результат */
.qrg-result {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 25px;
}

.qrg-qrcode-wrapper {
    position: relative;
    display: inline-block;
}

/* НОВЫЙ КОНТЕЙНЕР ДЛЯ QR-КОДА И ЛОГОТИПА */
.qrg-qr-inner {
    position: relative;
    display: inline-block;
}

.qrg-qrcode {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.qrg-qrcode img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* УЛУЧШЕННЫЙ КОНТЕЙНЕР ДЛЯ ЛОГОТИПА */
.qrg-logo-overlay-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrg-logo-overlay {
    background: white;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.qrg-logo-overlay img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    opacity: 0.9;
}

/* Кнопки действий */
.qrg-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

/* Кнопки поделиться */
.qrg-share {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.qrg-share-title {
    text-align: center;
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

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

/* Генерация */
.qrg-generate-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

/* Общие стили */
.qrg-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.qrg-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s;
}

.qrg-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.qrg-input-number {
    text-align: center;
}

.qrg-color {
    width: 100%;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

.qrg-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Кнопки */
.qrg-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qrg-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.qrg-generate-btn {
    background: #2196F3;
    padding: 15px 40px;
    font-size: 16px;
}

.qrg-generate-btn:hover {
    background: #1976D2;
}

/* Кнопки поделиться */
.qrg-share-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-decoration: none;
}

.qrg-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

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

/* Уведомления */
.qrg-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: 16px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: qrg-notification-fade 3s ease-in-out;
}

@keyframes qrg-notification-fade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* Индикатор загрузки */
.qrg-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

.qrg-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: qrg-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes qrg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qrg-loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

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

/* Desktop */
@media (max-width: 1024px) {
    .qrg-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet */
@media (max-width: 768px) {
    .qrg-container {
        padding: 15px;
    }
    
    .qrg-tabs {
        flex-direction: column;
    }
    
    .qrg-tab {
        min-width: auto;
    }
    
    .qrg-input-row {
        grid-template-columns: 1fr;
    }
    
    .qrg-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .qrg-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qrg-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .qrg-preset-logos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .qrg-preset-logo {
        padding: 10px;
    }
    
    .qrg-preset-logo img {
        width: 30px;
        height: 30px;
    }
    
    .qrg-actions {
        grid-template-columns: 1fr;
    }
    
    .qrg-share-buttons {
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .qrg-container {
        padding: 10px;
    }
    
    .qrg-presets-grid {
        grid-template-columns: 1fr;
    }
    
    .qrg-preset-logos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qrg-share-btn {
        width: 50px;
        height: 50px;
        font-size: 14px;
    }
    
    .qrg-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}
