/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #337AB7;      /* A professional, deep blue */
    --primary-dark: #2C3E50;    /* A dark, sophisticated blue-gray */
    --primary-light: #5D9CEC;   /* A bright, vibrant blue */

    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #E5E7EB;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-color-dark: #D1D5DB;

    /* Status Colors */
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    /* Shadow Values */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-large {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 2001;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.flash-message {
    pointer-events: auto;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.flash-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
}

.flash-success .flash-icon {
    background: #dcfce7;
    color: #166534;
}

.flash-error .flash-icon {
    background: #fee2e2;
    color: #991b1b;
}

.flash-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 480px;
    margin: 10vh auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: modalSlideIn 0.3s ease-out;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.notification-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.notification-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Navigation */
nav {
    background: white;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 80px;
    border-bottom: 1px solid var(--border-color);
}

.logo-stats-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.logo {
    height: 100%;
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Stats Grid */
.stats-grid {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.stat-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 15px 20px;
    text-align: left;
    width: 180px;
    margin: 0;
    transition: all 0.2s;

    /* Предотвращаем переполнение содержимым */
    overflow: hidden;
    word-wrap: break-word;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-box h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-box p {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Buttons */
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.primary-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}

.secondary-button {
    background-color: var(--primary-color); 
    color: white;
}

.secondary-button:hover {
    background-color: var(--primary-dark); 
    transform: translateY(-1px);
}

.secondary-button:active {
    transform: translateY(0);
}

.secondary-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Footer */
.footer {
    background: white;
    background-color: #f8f9fa;
    padding: 1.5rem 0;
    margin-top: auto;
    flex-shrink: 0;    
}

.padding-global {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.padding-section-small {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.main-content {
    flex: 1 0 auto;
}

.footer_component {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

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

.footer-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;    
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
    font-size: 16px;
    font-family: "Work Sans", sans-serif;
}

.footer-links a:hover {
    color: #343a40;
}

.footer-copyright {
    color: #6c757d;
}

.footer_link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer_link:hover {
    color: var(--primary-color);
}

.footer_home {
    font-weight: 600;
}

.footer_copy {
    color: var(--text-secondary);
    font-size: 16px;
    font-family: "Work Sans", sans-serif;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        height: auto;
        position: relative;
    }

    .logo-stats-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        height: auto;
        padding: 1rem;
    }

    .logo {
        height: 50px;
        margin-bottom: 1rem;
    }

    .stats-grid {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .stat-box {
        width: calc(50% - 10px);
        /* 2 блока в ряд с отступом */
        min-width: 150px;
        padding: 12px 15px;
        margin: 0;
    }

    .stat-box h3 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.footer_links {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.padding-global {
    padding-left: 1rem;
    padding-right: 1rem;
}

.container {
    padding: 0 0.5rem;
}

.flash-messages-container {
    right: 10px;
    left: 10px;
    max-width: none;
}

.modal-content {
    width: 95%;
    margin: 5vh auto;
    padding: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0;
    overflow: hidden;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}

.data-table th:hover {
    background-color: var(--bg-tertiary);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Zebra Striping */
.data-table tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-pending {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Action Buttons */
.table-action-btn {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.table-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Responsive Table */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
}

/* Общие стили для кнопок действий */
.boost-search-btn,
.get-updates-btn {
    height: 40px;
    padding: 0 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

/* Стили для иконок в кнопках */
.boost-search-btn svg,
.get-updates-btn svg {
    width: 27px;
    height: 27px;
    color: #FFB800;
    /* Желтый цвет для иконок */
}

/* Стили для текста кнопок */
.boost-search-btn span,
.get-updates-btn span {
    font-size: 0.875rem;
    font-weight: 400;
}

/* Hover эффекты */
.boost-search-btn:hover,
.get-updates-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    /* Желтая рамка при наведении */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Контейнер для кнопок действий */
.actions-cell {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
}

/* Специфичные стили для Boost Search */
.boost-search-btn svg path {
    stroke: #FFB800;
    stroke-width: 2px;
}

/* Специфичные стили для Get Updates */
.get-updates-btn svg path {
    fill: #FFB800;
    /* Желтый цвет для иконки колокольчика */
}

/* Активное состояние */
.boost-search-btn:active,
.get-updates-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Button Styles */
button[onclick*="handleAnalyze"],
/* Выбираем кнопку по атрибуту onclick */
.analyze-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hover эффект */
button[onclick*="handleAnalyze"]:hover,
.analyze-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Active состояние */
button[onclick*="handleAnalyze"]:active,
.analyze-button:active {
    transform: translateY(0);
}

/* Disabled состояние */
button[onclick*="handleAnalyze"]:disabled,
.analyze-button:disabled {
    background-color: var(--primary-light);
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .stat-box {
        width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Rest of your existing CSS... */

/* Стили для кликабельного названия сайта */
.target-site-name {
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.target-site-name:hover {
    color: var(--primary-color);
    /* Зеленый цвет при наведении */
    text-decoration: underline;
}

/* Добавляем небольшую анимацию при нажатии */
.target-site-name:active {
    transform: translateY(1px);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.stat-icon {
    color: var(--primary-color);
    opacity: 0.8;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-box {
        width: 100%;
        /* 1 блок в ряд */
        margin: 5px 0;
    }

    .stat-value {
        font-size: 2rem;
    }
}