/* Основные стили для сайта 1HYPE.ru */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.container-narrow {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

/* Широкий контейнер для рекламодателя */
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

/* Заголовок сайта */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0052cc;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content {
    padding: 2rem 0;
}

/* Навигация */
.nav-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #0052cc;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.nav-link.active {
    background: #0052cc;
    color: white;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #0052cc;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,82,204,0.2);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Стиль для поля с ошибкой */
.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Анимация тряски для ошибки */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-control.shake {
    animation: shake 0.5s ease-in-out;
}

/* Код подтверждения */
.verification-code {
    font-size: 24px;
    text-align: center;
    letter-spacing: 4px;
    font-family: monospace;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #0052cc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    margin: 5px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-outline {
    border: 2px solid #0052cc;
    color: #0052cc;
    background: transparent;
}

.btn-outline:hover {
    background: #0052cc;
    color: white;
}

.btn-full {
    width: 100%;
    padding: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: #6c757d;
    transform: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Карточки статистики */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #0052cc;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Секции */
.section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section h2 {
    margin-top: 0;
    color: #333;
}

.section h3 {
    color: #333;
    margin-bottom: 1rem;
}

/* Уведомления */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #b6d4db;
    color: #0c5460;
}

/* Текст */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Ссылки */
a {
    color: #0052cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

/* Товары */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-content {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #333;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0052cc;
    margin-bottom: 0.5rem;
}

.product-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    margin: 0;
    color: #333;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Статусы */
.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-connected {
    background: #d4edda;
    color: #155724;
}

.status-disconnected {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

.status-stopped {
    background: #f8d7da;
    color: #721c24;
}

/* Роли */
.role-blogger {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.role-advertiser {
    background: #0052cc;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.role-agent {
    background: #6f42c1;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Фильтры */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #333;
}

.filter-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Красивые уведомления */
.notification {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
}

.notification-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.notification-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.notification-info {
    background: #d1ecf1;
    border-color: #b6d4db;
    color: #0c5460;
}

.notification-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.notification .close-btn {
    float: right;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    margin-left: 10px;
}

.notification .close-btn:hover {
    opacity: 1;
}

/* Анимация появления уведомлений */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification.animate {
    animation: slideInDown 0.3s ease;
}

/* Контейнер для уведомлений */
.notifications-container {
    position: relative;
    margin: 15px 0;
}

/* Реферальная программа */
.referral-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.referral-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.referral-link {
    background: rgba(255,255,255,0.2);
    padding: 1rem;
    border-radius: 6px;
}

.referral-link h4 {
    margin: 0 0 0.5rem 0;
}

.link-url {
    font-family: monospace;
    word-break: break-all;
    background: rgba(255,255,255,0.3);
    padding: 0.5rem;
    border-radius: 3px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.short-link {
    font-weight: bold;
    color: #ff6b35;
}

.copy-btn {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: #218838;
}

/* Условия программы */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.condition-card {
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 6px;
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #0052cc;
    border-bottom-color: #0052cc;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

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

/* Графики */
.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Метрики */
.metric-positive {
    color: #28a745;
    font-weight: bold;
}

.metric-neutral {
    color: #6c757d;
}

.metric-negative {
    color: #dc3545;
    font-weight: bold;
}

/* Настройки API */
.help-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.inn-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.inn-search-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.loader {
    display: none;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0052cc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

.auto-filled {
    background-color: #e8f5e8 !important;
}

/* Вспомогательные классы */
.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.inline {
    display: inline;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 1rem;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .container-narrow {
        margin: 20px auto;
        padding: 10px;
    }
    
    .container-wide {
        padding: 0 10px;
    }
    
    .card, .card-narrow {
        padding: 20px;
        margin: 10px 0;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* Добавить в assets/css/styles.css */

/* Стили для поля телефона */
input[type="tel"] {
    font-family: monospace;
    letter-spacing: 1px;
}

/* Анимация для индикатора загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Улучшенные стили для уведомлений */
.notifications-container {
    margin-top: 15px;
}

.notifications-container .alert {
    animation: slideDown 0.3s ease-out;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для кнопки повторной отправки */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-secondary:disabled {
    background-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили для поля кода подтверждения */
.verification-code {
    font-family: monospace;
    font-size: 18px;
    letter-spacing: 3px;
    text-align: center;
    font-weight: bold;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    input[type="tel"] {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .verification-code {
        font-size: 16px;
        letter-spacing: 2px;
    }
}