* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #1a73e8;
    font-size: 24px;
}

.accounts-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.account-badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-badge .remove {
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.account-badge .remove:hover {
    transform: scale(1.2);
    color: #d93025;
}

.add-account-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.add-account-btn:hover {
    background: #1557b0;
}

.controls {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.control-group {
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.date-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.quick-date-btn {
    padding: 8px 16px;
    border: 1px solid #dadce0;
    background: white;
    color: #5f6368;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-date-btn:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.quick-date-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.date-separator {
    width: 1px;
    height: 24px;
    background: #dadce0;
    margin: 0 5px;
}

.refresh-btn {
    padding: 8px 12px;
    border: 1px solid #dadce0;
    background: white;
    color: #1a73e8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.refresh-btn:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    transform: rotate(90deg);
}

.refresh-btn:active {
    background: #e8f0fe;
    transform: rotate(180deg);
}

.date-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-inputs input {
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    color: #5f6368;
}

.date-inputs input:focus {
    outline: none;
    border-color: #1a73e8;
}

.metrics-toggle {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    transition: color 0.2s;
}

.metric-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.metric-checkbox.active {
    color: #1a73e8;
    font-weight: 500;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #5f6368;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 400;
    color: #202124;
}

/* ✅ Unified Stats Section (GSC + Ahrefs in one row) */
.unified-stats {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.unified-stats-section {
    display: flex;
    width: 50%;
    padding: 20px;
}

.unified-stats-gsc {
    background: white;
    border-right: 2px solid #e8eaed;
}

.unified-stats-ahrefs {
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
}

.unified-stat {
    flex: 1;
    text-align: center;
    padding: 0 10px;
}

.unified-stat h3 {
    color: #5f6368;
    font-size: 11px;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unified-stat .value {
    font-size: 24px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 4px;
}

.unified-stat .stat-comparison {
    font-size: 12px;
    margin-top: 4px;
}

/* ✅ Ahrefs Card Styles */
.stat-card.ahrefs {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e8eaed;
}

.stat-card.ahrefs h3 {
    color: #1a73e8;
    font-size: 14px;
    margin-bottom: 12px;
}

.ahrefs-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ahrefs-metric {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e8eaed;
}

.ahrefs-label {
    font-size: 10px;
    color: #5f6368;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ahrefs-value {
    font-size: 20px;
    font-weight: 600;
    color: #202124;
}

.ahrefs-updated {
    text-align: center;
    font-style: italic;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.site-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
    position: relative;
}

.site-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.site-card.favorited {
    border: 2px solid #fbbc04;
}

.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #fbbc04;
}

.site-card-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 30px;
}

.site-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.site-card-header h3 {
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}

/* ✅ DR Badge Styles */
.dr-badge {
    display: inline-block;
    padding: 3px 8px;
    margin-left: 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
    cursor: help;
    transition: all 0.2s ease;
}

.dr-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 🟢 Успешно проверено */
.dr-badge.dr-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid #059669;
}

/* 🔵 Проверяется */
.dr-badge.dr-checking {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: 1px solid #2563eb;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 🟡 В очереди */
.dr-badge.dr-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 1px solid #d97706;
}

/* 🔴 Ошибка */
.dr-badge.dr-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 1px solid #dc2626;
}

.site-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

.site-stat {
    flex: 1;
}

.site-stat .label {
    color: #5f6368;
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.site-stat .value {
    color: #202124;
    font-weight: 500;
    font-size: 18px;
}

.site-chart-container {
    height: 120px;
    position: relative;
    margin-top: 15px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #5f6368;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #5f6368;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Details page additional styles */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.site-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.site-header h1 {
    color: #202124;
    font-size: 28px;
    margin-bottom: 10px;
    word-break: break-word;
}

.site-header h1 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-header h1 a:hover {
    color: #1a73e8;
    text-decoration: underline;
}

.site-header .period {
    color: #5f6368;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 20px;
    border: 1px solid #1a73e8;
    background: white;
    color: #1a73e8;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: #e8f0fe;
}

.action-btn.primary {
    background: #1a73e8;
    color: white;
}

.action-btn.primary:hover {
    background: #1557b0;
}

.period-comparison {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-comparison label {
    font-size: 14px;
    color: #5f6368;
    margin-right: 10px;
}

.period-comparison input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.comparison-dates {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-card.comparison {
    position: relative;
}

.stat-comparison {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    font-size: 14px;
}

.stat-comparison .arrow {
    font-size: 18px;
}

.stat-comparison.positive {
    color: #0f9d58;
}

.stat-comparison.negative {
    color: #d93025;
}

.data-tables {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.data-table-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.data-table-card h3 {
    color: #202124;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    background: white;
    color: #5f6368;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: #f8f9fa;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    background: #e8eaed;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #202124;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.metric-value {
    font-weight: 500;
}

.position-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.position-change.up {
    background: #e6f4ea;
    color: #0f9d58;
}

.position-change.down {
    background: #fce8e6;
    color: #d93025;
}

.position-change.neutral {
    background: #f8f9fa;
    color: #5f6368;
}

.ctr-anomaly {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.chart-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
}

.chart-card h3 {
    color: #202124;
    font-size: 18px;
    margin-bottom: 20px;
}

.chart-container-large {
    height: 300px;
    position: relative;
}

.analytics-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.analytics-card h3 {
    color: #202124;
    font-size: 18px;
    margin-bottom: 15px;
}

.integration-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dadce0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #5f6368;
}

.integration-placeholder h4 {
    font-size: 16px;
    margin-bottom: 10px;
}

.integration-placeholder p {
    font-size: 14px;
    margin-bottom: 15px;
}

.show-more-container {
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
}

.show-more-btn {
    padding: 8px 20px;
    border: 1px solid #1a73e8;
    background: white;
    color: #1a73e8;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 5px;
}

.show-more-btn:hover {
    background: #e8f0fe;
}

.fi {
    width: 20px;
    height: 15px;
    display: inline-block;
    margin-right: 8px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.table-summary {
    font-size: 14px;
    color: #5f6368;
}

.rows-per-page {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.rows-per-page:hover {
    border-color: #1a73e8;
}

@media (max-width: 1200px) {
    .data-tables {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1400px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sites-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0;
    }
}

@media (max-width: 600px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

/* ========== MOBILE RESPONSIVE ========== */

@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    /* Header */
    .header {
        padding: 12px 15px;
        border-radius: 0;
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    /* Accounts Section */
    .accounts-section {
        padding: 0;
        overflow: hidden;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    #googleAccounts {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .account-badge {
        font-size: 13px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        gap: 10px;
    }
    
    .account-badge > span:first-child {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    
    .account-badge .remove {
        font-size: 20px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin: 0;
    }
    
    .add-account-btn {
        padding: 12px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
        margin-top: 5px;
        min-height: 44px;
    }
    
    /* Controls */
    .controls {
        padding: 15px;
        border-radius: 0;
        margin-bottom: 15px;
    }
    
    .date-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-inputs {
        flex-direction: column;
        width: 100%;
    }
    
    .date-inputs input {
        width: 100%;
    }
    
    .quick-date-btn {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        min-width: 70px;
    }
    
    /* Metrics Toggle */
    .metrics-toggle {
        padding: 12px 15px;
        gap: 8px;
    }
    
    .metric-checkbox {
        font-size: 13px;
    }
    
    /* Stats Cards */
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 11px;
    }
    
    .stat-card .value {
        font-size: 20px;
    }
    
    /* Sites Grid */
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .site-card {
        padding: 15px;
    }
    
    .site-card-header h3 {
        font-size: 14px;
    }
    
    .favorite-btn {
        font-size: 18px;
        width: 32px;
        height: 32px;
        top: 12px;
        right: 12px;
    }
    
    .site-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .site-stat .label {
        font-size: 10px;
    }
    
    .site-stat .value {
        font-size: 16px;
    }
    
    .site-chart-container {
        height: 150px;
        margin-top: 12px;
    }
    
    /* No Data */
    .no-data {
        padding: 30px 15px;
    }
    
    .no-data-icon {
        font-size: 40px;
    }
    
    .no-data p {
        font-size: 14px;
    }
}

/* Extra Small Devices (< 480px) */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .account-badge {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .add-account-btn {
        font-size: 13px;
        padding: 10px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
    
    .stat-card .value {
        font-size: 24px;
    }
    
    .sites-grid {
        padding: 0 12px;
    }
    
    .site-stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quick-date-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 60px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .site-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .site-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    
    .favorite-btn:active,
    .add-account-btn:active,
    .quick-date-btn:active,
    .metric-checkbox:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }
    
    /* Увеличиваем область нажатия */
    .favorite-btn,
    .account-badge .remove {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ============================================================================
   BULK CHECKER STYLES
   ============================================================================ */

.bulk-checker-card,
.bulk-history-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bulk-checker-card h2,
.bulk-history-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 20px;
    color: #202124;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #5f6368;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.bulk-textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 300px;
}

.url-counter {
    text-align: right;
    margin-top: 8px;
    font-size: 14px;
    color: #5f6368;
}

.btn-large {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
}

.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
}

/* Progress Bar */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: #e8eaed;
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4285f4 0%, #34a853 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #202124;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: #e6f4ea;
    color: #137333;
}

.badge-warning {
    background: #fef7e0;
    color: #b06000;
}

.badge-info {
    background: #e8f0fe;
    color: #1967d2;
}

.badge-error {
    background: #fce8e6;
    color: #c5221f;
}

/* Download Button */
.btn-download {
    background: #34a853;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #2d8e47;
}

.btn-download:active {
    transform: scale(0.98);
}

/* Navigation Tabs */
.navigation-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e8eaed;
}

.nav-tab {
    padding: 12px 24px;
    text-decoration: none;
    color: #5f6368;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: #202124;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
}

.nav-tab.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
}

/* ============================================
   NOTES SYSTEM STYLES
   ============================================ */

/* Modal window styles */
.note-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.note-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.note-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.note-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #202124;
}

.note-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.note-modal-close:hover {
    background: #f1f3f4;
}

.note-modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #202124;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
}

.form-control[readonly] {
    background: #f1f3f4;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.note-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f1f3f4;
    color: #5f6368;
}

.btn-secondary:hover {
    background: #e8eaed;
}

/* Notes popup styles */
.notes-popup {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    min-width: 300px;
    max-width: 400px;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notes-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    color: #202124;
}

.notes-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.notes-popup-close:hover {
    background: #e8eaed;
}

.notes-popup-list {
    overflow-y: auto;
    max-height: 440px;
}

.note-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e8eaed;
    transition: background 0.2s;
}

.note-item:last-child {
    border-bottom: none;
}

.note-item:hover {
    background: #f8f9fa;
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-type-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.note-item-actions {
    display: flex;
    gap: 4px;
}

.note-item-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-item-btn:hover {
    background: #e8eaed;
}

.note-item-content {
    color: #3c4043;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 6px;
}

.note-item-preview {
    color: #5f6368;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-item-time {
    font-size: 12px;
    color: #5f6368;
}

/* Responsive */
@media (max-width: 768px) {
    .card-header-with-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .navigation-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .nav-tab {
        border-bottom: 1px solid #e8eaed;
        border-left: 3px solid transparent;
    }

    .nav-tab.active {
        border-left-color: #4285f4;
        border-bottom-color: #e8eaed;
    }

    .note-modal-content {
        width: 95%;
        margin: 20px;
    }

    .notes-popup {
        max-width: 90%;
        left: 5% !important;
        right: 5%;
    }
}

/* ============================================
   TABS SYSTEM STYLES (Statistics / Backlinks)
   ============================================ */

.tabs-container {
    display: flex;
    gap: 0;
    margin: 24px 0 0 0;
    border-bottom: 2px solid #e8eaed;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #1a73e8;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* ============================================
   BACKLINKS TABLE STYLES
   ============================================ */

.backlinks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.backlinks-header h3 {
    margin: 0;
}

.backlinks-count {
    font-size: 14px;
    color: #5f6368;
    padding: 4px 12px;
    background: #f1f3f4;
    border-radius: 12px;
}

.backlinks-table {
    width: 100%;
}

.backlinks-table thead th {
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
}

.backlinks-table thead th:hover {
    background: #e8eaed;
}

.backlinks-table thead th:last-child {
    cursor: default;
}

.backlinks-table thead th:last-child:hover {
    background: #f8f9fa;
}

.sort-indicator {
    font-size: 12px;
    color: #1a73e8;
    margin-left: 4px;
}

.backlink-url {
    max-width: 400px;
}

.backlink-url a {
    color: #1a73e8;
    text-decoration: none;
    word-break: break-all;
}

.backlink-url a:hover {
    text-decoration: underline;
}

.backlink-status {
    text-align: center;
    font-size: 16px;
}

.backlink-actions {
    text-align: center;
    white-space: nowrap;
}

.backlink-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.backlink-btn:hover:not(:disabled) {
    background: #f1f3f4;
}

.backlink-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive for tabs */
@media (max-width: 768px) {
    .tabs-container {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn {
        border-bottom: 1px solid #e8eaed;
        border-left: 3px solid transparent;
        bottom: 0;
        text-align: left;
    }

    .tab-btn.active {
        border-left-color: #1a73e8;
        border-bottom-color: #e8eaed;
    }

    .backlinks-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .backlink-url {
        max-width: 200px;
    }
}

/* ====================================================================
   Progress Bar for Backlinks Check
   ==================================================================== */

.check-progress {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

/* Compact check button in status column */
.backlink-check-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.backlink-check-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.backlink-check-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}