/* =====================================================================
   Единый файл стилей, вынесенный из inline <style> всех представлений.
   Подключён в Views/Shared/_Layout.cshtml и Views/Auth/Login.cshtml.
   ===================================================================== */

/* ---------- Views/Shared/_Layout.cshtml ---------- */
.navbar-brand {
    font-weight: bold;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
}

.badge-secondary {
    background-color: #6c757d;
}

.table th {
    background-color: #f8f9fa;
}

.navbar {
    padding: 0.5rem 0;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

    .dropdown-item:hover {
        background-color: #f8f9fa;
    }

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.table-name {
    font-family: "Trebuchet MS", Helvetica, sans-serif;
}

/* ---------- Views/Auth/Login.cshtml (страница без layout, скоуп: body.login-page) ---------- */
body.login-page {
    background-color: #f8f9fa;
    height: 100vh;
    display: flex;
    align-items: center;
}

body.login-page .login-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

body.login-page .login-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

body.login-page .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ---------- Views/Blacklist/Index.cshtml ---------- */
.badge.bg-type {
    font-weight: 600;
    font-size: 0.8em;
    padding: 0.4em 0.6em;
}

    .badge.bg-type.user-agent {
        background-color: #2c5aa0 !important;
        color: white !important;
    }

    .badge.bg-type.referrer {
        background-color: #28a745 !important;
        color: white !important;
    }

    .badge.bg-type.ip {
        background-color: #dc3545 !important;
        color: white !important;
    }

    .badge.bg-type.sub_id {
        background-color: #6f42c1 !important;
        color: white !important;
    }

.badge.bg-match {
    background-color: #17a2b8 !important;
    color: white !important;
    font-weight: 500;
    font-size: 0.8em;
    padding: 0.4em 0.6em;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
    font-weight: 600;
    font-size: 0.8em;
    padding: 0.4em 0.6em;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
    font-weight: 600;
    font-size: 0.8em;
    padding: 0.4em 0.6em;
}

/* ---------- Views/Campaigns/Index.cshtml ---------- */
.tracking-url {
    max-width: 150px;
    cursor: help;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
    }

    .tracking-url {
        max-width: 120px;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.8rem;
    }

    .tracking-url {
        max-width: 100px;
    }
}

/* ---------- Views/Diag/Index.cshtml ---------- */
.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

/* ---------- Views/Home/Index.cshtml ---------- */
.health-metric-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .health-metric-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    .health-metric-card.warning {
        border-color: #ffc107;
        background: linear-gradient(45deg, #fff3cd, #ffffff);
    }

    .health-metric-card.danger {
        border-color: #dc3545;
        background: linear-gradient(45deg, #f8d7da, #ffffff);
    }

.health-status-healthy {
    color: #28a745;
}

.health-status-degraded {
    color: #ffc107;
}

.health-status-unhealthy {
    color: #dc3545;
}

.metric-trend-up {
    color: #dc3545;
}

.metric-trend-down {
    color: #28a745;
}

.metric-trend-stable {
    color: #6c757d;
}

.filter-saved {
    border-color: #28a745 !important;
    background-color: rgba(40,167,69,0.05);
}

.filter-saving {
    position: relative;
}

    .filter-saving::after {
        content: "✓";
        position: absolute;
        top: -5px;
        right: -5px;
        background: #28a745;
        color: white;
        border-radius: 50%;
        width: 16px;
        height: 16px;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: fadeInOut 2s ease-in-out;
    }

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* ---------- Views/Home/About.cshtml ---------- */
.step-item {
    display: flex;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.tracking-flow {
    max-width: 300px;
    margin: 0 auto;
}

.flow-number {
    background: #007bff;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
}

.flow-text {
    font-size: 0.9em;
}

.flow-arrow {
    color: #007bff;
    font-size: 1.2em;
}

.feature-item {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

    .feature-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.tip-item h6 {
    font-size: 0.95em;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1em;
    line-height: 1.3;
    margin-bottom: 2px;
}

.metric-label {
    line-height: 1.2;
    font-size: 0.8em;
}

.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: #495057;
}

code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #e83e8c;
}

.bg-dark code {
    background-color: #2d3748;
    color: #90cdf4;
}

/* ---------- Views/OfferAuction/Manager.cshtml ---------- */
.auction-selector {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 15px;
    position: relative;
}

.offers-container {
    min-height: 400px;
}

.offer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

    .offer-row.missing {
        background-color: #fff3cd;
    }

.offer-checkbox {
    width: 24px;
    text-align: center;
}

    .offer-checkbox input {
        cursor: pointer;
        width: 16px;
        height: 16px;
    }

.offer-badge {
    width: 32px;
    text-align: center;
}

.badge-p {
    background-color: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
}

.badge-s {
    background-color: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
}

.offer-name {
    flex: 1;
    font-size: 13px;
}

.weight-cell {
    width: 70px;
    text-align: center;
}

.weight-input {
    width: 60px;
    text-align: center;
    font-size: 12px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.sync-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: #ffc107;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .sync-btn i {
        font-size: 14px;
        font-weight: bold;
    }

    .sync-btn:hover {
        background-color: #e0a800;
    }

.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .remove-btn i {
        font-size: 16px;
    }

    .remove-btn:hover {
        background-color: #ffe6e6;
    }

.left-col .card-header {
    background-color: #0d6efd;
    color: white;
}

.right-col .card-header {
    background-color: #198754;
    color: white;
}

.card {
    border: 1px solid #ddd;
}

.card-body {
    padding: 15px;
}

.batch-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-batch {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
}

    .btn-batch:hover {
        background-color: #e9ecef;
    }

.btn-batch-primary {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

    .btn-batch-primary:hover {
        background-color: #e0a800;
    }

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.notification-success {
    background-color: #28a745;
    color: white;
}

.notification-error {
    background-color: #dc3545;
    color: white;
}

.notification-warning {
    background-color: #ffc107;
    color: #000;
}

.notification-info {
    background-color: #17a2b8;
    color: white;
}

/* ---------- Views/Offers/Checker.cshtml ---------- */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    font-weight: bold;
}

.border-danger {
    border-width: 2px;
}

/* ---------- Views/Offers/Overview.cshtml ---------- */
.btn-group-xs > .btn {
    padding: 0.125rem 0.25rem;
    font-size: 0.7rem;
    line-height: 1.2;
}

.list-group-item {
    padding: 0.3rem 0.5rem;
}

.card.h-100 {
    height: calc(100% - 0.5rem) !important;
}

/* ---------- Views/Offers/Stat.cshtml ---------- */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-bar {
    background-color: #17a2b8;
    color: white;
    font-size: 0.75rem;
    line-height: 20px;
}

.table td {
    vertical-align: middle;
}

/* ---------- Views/Offers/UrlChanger.cshtml ---------- */
#offerList {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

#offerList .list-group-item {
    border-left: none;
    border-right: none;
}

    #offerList .list-group-item:first-child {
        border-top: none;
    }

    #offerList .list-group-item:last-child {
        border-bottom: none;
    }

.text-truncate {
    max-width: 100%;
}

#progressBar .progress {
    height: 25px;
}

/* ---------- Views/Postbacks/Index.cshtml ---------- */
.form-control-xs {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.775rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn-xs {
    padding: 0.25rem 2rem;
    font-size: 0.775rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

    .btn-xs i {
        font-size: 0.7rem;
    }

.table-xs th,
.table-xs td {
    padding: 0.25rem 0.5rem;
    font-size: 0.775rem;
}

.table-xs .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.3rem;
}

.pagination-xs .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.775rem;
    line-height: 1.5;
}

.x-small {
    font-size: 0.775rem;
}

.alert-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* ---------- Views/Shared/_CampaignForm.cshtml ---------- */
.form-text.text-muted {
    font-size: 0.875em;
}

.smaller {
    font-size: 0.75em;
}

/* ---------- Views/Shared/_TrafficSourceForm.cshtml ---------- */
.bg-light {
    background-color: #f8f9fa !important;
}

.card-header.bg-light {
    background-color: #e9ecef !important;
    border-bottom: 1px solid #dee2e6;
}

/* ---------- Views/OfferAuction/Details.cshtml ---------- */
.table-success {
    background-color: #d4edda !important;
}

.list-group-item-success {
    background-color: #d4edda !important;
}

.badge {
    font-size: 0.8rem;
}

/* ---------- Views/Error/* (общие правила) ---------- */
.error-container {
    padding: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.error-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #495057;
}

.error-description {
    font-size: 1.2rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

/* Index: bounce */
.error-page-general .error-icon {
    animation: bounce 2s infinite;
}

/* NotFound / ServerError: pulse */
.error-page-404 .error-icon,
.error-page-500 .error-icon {
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* NotFound: быстрые ссылки */
.error-page-404 .quick-links .btn {
    border-radius: 20px;
    transition: all 0.3s ease;
}

    .error-page-404 .quick-links .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
