:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --glow-primary: rgba(102, 126, 234, 0.4);
    --glow-success: rgba(56, 239, 125, 0.4);
    --glow-danger: rgba(235, 51, 73, 0.4);

    /* Fallback цвета для браузеров без backdrop-filter */
    --fallback-card-bg: rgba(30, 60, 114, 0.7);
    --fallback-navbar-bg: rgba(30, 60, 114, 0.85);
    --fallback-form-bg: rgba(30, 60, 114, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f1f3d 0%, #1a2f5a 25%, #2d4575 50%, #1e3557 75%, #29497d 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Static background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(52, 138, 199, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphism Navbar */
.navbar {
    padding: 1.5rem 0;
    background: rgba(30, 60, 114, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    position: relative;
    z-index: 1000;
}

@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .navbar {
        background: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    margin: 0 0.25rem;
    padding: 0.6rem 1.2rem !important;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.navbar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.navbar .nav-link:hover::before {
    transform: translateX(0);
}

.navbar .nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Glass Cards */
.card {
    background: rgba(40, 70, 120, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        0 2px 8px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

@supports (backdrop-filter: blur(40px)) or (-webkit-backdrop-filter: blur(40px)) {
    .card {
        background: rgba(40, 70, 120, 0.7);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
    }
}

.card-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 24px 24px 0 0;
}

.card-header h5 {
    font-weight: 700;
    color: white;
    margin: 0;
    font-size: 1.25rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.card-body {
    padding: 2rem;
    color: white;
}

/* Stat Cards with Gradient Glass */
.stat-card {
    background: rgba(40, 70, 120, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    color: white;
    overflow: hidden;
    position: relative;
}

@supports (backdrop-filter: blur(40px)) or (-webkit-backdrop-filter: blur(40px)) {
    .stat-card {
        background: rgba(40, 70, 120, 0.7);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
    }
}

.stat-card .card-body {
    position: relative;
    z-index: 1;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.9;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

/* Modern Buttons */
.btn {
    border-radius: 14px;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #7474bf 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .btn-primary {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(116, 116, 191, 0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(116, 116, 191, 1) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #348ac7 0%, #3d9cd9 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .btn-success {
        background: linear-gradient(135deg, rgba(52, 138, 199, 0.95) 0%, rgba(61, 156, 217, 0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.btn-success:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(52, 138, 199, 0.5);
    background: linear-gradient(135deg, rgba(52, 138, 199, 1) 0%, rgba(61, 156, 217, 1) 100%);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(235, 51, 73, 0.9) 0%, rgba(244, 92, 67, 0.9) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--glow-danger);
    background: linear-gradient(135deg, rgba(235, 51, 73, 1) 0%, rgba(244, 92, 67, 1) 100%);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 10px;
}

/* Glass Forms */
.form-control {
    background: rgba(40, 70, 120, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 0.875rem 1.25rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

@supports (backdrop-filter: blur(15px)) or (-webkit-backdrop-filter: blur(15px)) {
    .form-control {
        background: rgba(40, 70, 120, 0.7);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow:
        0 0 0 4px rgba(102, 126, 234, 0.15),
        inset 0 1px 3px rgba(0, 0, 0, 0.1);
    color: white;
    outline: none;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Glass Tables */
.table {
    color: white !important;
    margin-bottom: 0;
    background: transparent !important;
}

.table thead {
    background: rgba(40, 70, 120, 0.6) !important;
    backdrop-filter: blur(10px);
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .table thead {
        background: rgba(40, 70, 120, 0.4) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.table-responsive {
    background: transparent !important;
}

.table thead th {
    color: white !important;
    font-weight: 700;
    border: none;
    padding: 1.25rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.table tbody td {
    vertical-align: middle;
    padding: 1.25rem;
    border-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.table tbody td.text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.table tbody td.fw-medium {
    color: white !important;
}

.table tbody td code {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    color: white !important;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Ultra-specific selectors for companiesTable to override Bootstrap */
#companiesTable,
#companiesTable tbody,
#companiesTable tbody tr {
    background: transparent !important;
    background-color: transparent !important;
}

#companiesTable tbody tr td,
#companiesTable tbody tr td.fw-medium,
#companiesTable tbody tr td.text-muted,
#companiesTable tbody tr td.text-muted.small,
#companiesTable tbody tr td.small {
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    background: transparent !important;
    background-color: transparent !important;
}

#companiesTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

#companiesTable tbody tr td code {
    color: white !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Copyable elements */
code.copyable {
    cursor: pointer;
    transition: all 0.2s ease;
}

code.copyable:hover {
    background: rgba(102, 126, 234, 0.4) !important;
    transform: scale(1.02);
}

#companiesTable thead,
#companiesTable thead tr {
    background: rgba(40, 70, 120, 0.5) !important;
}

#companiesTable thead tr th {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    background: transparent !important;
}

/* Glass Alerts */
.alert {
    border: none;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.25rem 1.5rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(235, 51, 73, 0.15);
    color: #fff;
    border-color: rgba(235, 51, 73, 0.3);
}

.alert-success {
    background: rgba(56, 239, 125, 0.15);
    color: #fff;
    border-color: rgba(56, 239, 125, 0.3);
}

.alert-info {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
    border-color: rgba(102, 126, 234, 0.3);
}

/* Badge */
.badge {
    padding: 0.6em 1.2em;
    border-radius: 14px;
    font-weight: 700;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

/* Page headers */
h1 {
    color: white;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

h1 i {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* Search result - no animation */
#searchResult .card {
    opacity: 1;
}

/* Company result card */
.card.bg-light {
    background: rgba(40, 70, 120, 0.85) !important;
    backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@supports (backdrop-filter: blur(30px)) or (-webkit-backdrop-filter: blur(30px)) {
    .card.bg-light {
        background: rgba(40, 70, 120, 0.7) !important;
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
    }
}

.card.bg-light h5,
.card.bg-light span,
.card.bg-light small,
.card.bg-light div,
.card.bg-light .opacity-75,
.card.bg-light .fw-medium,
.card.bg-light .fw-semibold {
    color: white !important;
}

.card.bg-light .opacity-75 {
    opacity: 0.75 !important;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state i {
    font-size: 5rem;
    opacity: 0.4;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.empty-state h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
}

/* Footer */
footer {
    background: rgba(30, 60, 114, 0.85) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -8px 32px 0 rgba(31, 38, 135, 0.1);
    position: relative;
    z-index: 10;
}

@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    footer {
        background: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
}

footer small {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Container adjustments */
.container, main {
    position: relative;
    z-index: 1;
}

/* Login page */
.login-card {
    max-width: 450px;
    margin: 0 auto;
}

.login-card .card {
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(200%);
}

.login-card .card-body {
    padding: 3rem;
}

/* Text colors */
.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-dark {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Spinner for loading states */
.spinner-border {
    border-color: rgba(255, 255, 255, 0.3);
    border-right-color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

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

    .stat-card .stat-icon {
        font-size: 2.5rem;
    }
}

/* Additional micro-interactions */
.btn:active {
    transform: translateY(-1px) scale(0.98);
}

.card-header h5,
.form-label,
h1 {
    user-select: none;
}

/* Pagination */
.pagination .page-item .page-link {
    background: rgba(40, 70, 120, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.2s ease;
}

.pagination .page-item .page-link:hover {
    background: rgba(102, 126, 234, 0.5);
    border-color: rgba(102, 126, 234, 0.6);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    border-color: transparent;
}

.pagination .page-item.disabled .page-link {
    background: rgba(40, 70, 120, 0.4);
    color: rgba(255, 255, 255, 0.4);
}

.pagination.mb-0,
.pagination.mb-0 .page-link {
    color: white;
}

/* Card header h6 */
.card-header h6.mb-0 {
    color: white;
}

/* Search box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    pointer-events: none;
}

.search-box input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    color: white;
    font-size: 0.875rem;
    width: 180px;
    transition: all 0.2s ease;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.fw-bold{
    color: #ffff;
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    width: 220px;
}
