/* 
 * Сучасні стилі для плагіну Amateur Rating System (UA)
 * Безпечні простори імен (класи починаються з .amrs-)
 */

 .amrs-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #374151;
    padding: 20px 0;
}

/* Typography */
.amrs-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111827;
}

.amrs-title-section {
    font-size: 20px;
    font-weight: 700;
    margin: 30px 0 20px;
    color: #111827;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 10px;
}

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.font-bold { font-weight: bold !important; }
.font-medium { font-weight: 500 !important; }
.amrs-text-success { color: #16A34A !important; }
.amrs-text-danger { color: #DC2626 !important; }
.amrs-text-blue, .text-blue, .text-blue-600 { color: #2563EB !important; }
.text-gray-500 { color: #6B7280 !important; }
.text-gray-600 { color: #4B5563 !important; }

/* Shortcode Tables */
.amrs-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #E5E7EB;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .amrs-table-container {
        padding: 5px;
        overflow-x: auto;
    }
    
    table.amrs-table {
        word-break: normal;
        font-size: 10px !important;
    }
    table.amrs-table th, table.amrs-table td {
        padding: 4px 2px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
}
@media (max-width: 480px) {
    table.amrs-table {
        font-size: 8px !important;
    }
    table.amrs-table th, table.amrs-table td {
        padding: 2px 1px !important;
        font-size: 8px !important;
    }
}

table.amrs-table {
    width: 100% !important;
    border-collapse: collapse;
}

table.amrs-table th {
    background: #F9FAFB !important;
    border-bottom: 2px solid #E5E7EB !important;
    color: #374151;
    padding: 12px !important;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

table.amrs-table td {
    padding: 12px !important;
    border-bottom: 1px solid #F3F4F6 !important;
    font-size: 14px;
}

table.amrs-table tr:hover td {
    background: #EFF6FF !important;
}

a.amrs-link {
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
}
a.amrs-link:hover { text-decoration: underline; }

/* Profile Grid */
.amrs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media(min-width: 900px) {
    .amrs-grid {
        grid-template-columns: 320px 1fr;
    }
}

.amrs-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid #E5E7EB;
    padding: 24px;
}

.amrs-profile-card {
    border-top: 4px solid #2563EB;
}

.amrs-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    object-fit: cover;
    box-shadow: 0 0 0 4px #EFF6FF;
}

.amrs-name {
    text-align: center;
    font-size: clamp(28px, 6vw, 56px) !important;
    line-height: 1.1 !important;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: #111827;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.amrs-info-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.amrs-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}

.amrs-info-row:last-child {
    border-bottom: none;
}

.amrs-label {
    color: #6B7280;
    font-size: 13px;
    text-transform: uppercase;
}

.amrs-highlight-row {
    background: #EFF6FF;
    margin: 0 -24px;
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
}

/* Tournament History Card */
.amrs-tournament-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.amrs-tournament-header {
    background: #F9FAFB;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.amrs-tournament-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.amrs-tournament-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    background: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
}

.amrs-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.amrs-history-table th {
    background: #fff;
    color: #6B7280;
    padding: 12px 20px;
    font-weight: 500;
    border-bottom: 1px solid #E5E7EB;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-align: left;
}

.amrs-history-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
}

.amrs-history-table tr:last-child td {
    border-bottom: none;
}

.amrs-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.badge-win {
    background: #DCFCE7;
    color: #166534;
}

.badge-lose {
    background: #FEE2E2;
    color: #991B1B;
}

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

/* DataTables Overrides для пошуку та кнопок */
.amrs-dt-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.amrs-dt-top .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 0 !important;
}

.amrs-dt-top .dataTables_length {
    float: none !important;
    margin-bottom: 0 !important;
}

.amrs-dt-top .dataTables_length label {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    color: #4B5563;
    font-size: 14px;
}

.amrs-dt-top .dataTables_length select {
    margin: 0 8px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #D1D5DB;
    background-color: #F9FAFB;
    outline: none;
}

.amrs-dt-top .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    color: #4B5563;
}

.amrs-table-container .dataTables_wrapper .dataTables_filter input {
    margin-left: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #D1D5DB;
    background-color: #F9FAFB;
    min-width: 250px;
    outline: none;
    transition: all 0.2s ease;
}

.amrs-table-container .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background-color: #fff;
}

.amrs-dt-top .dt-buttons {
    float: none !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.amrs-table-container .dataTables_wrapper .dt-buttons .amrs-btn-export {
    background: #fff !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 6px !important;
    color: #374151 !important;
    padding: 6px 14px !important;
    margin-right: 0 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.amrs-table-container .dataTables_wrapper .dt-buttons .amrs-btn-export:hover {
    background: #F9FAFB !important;
    color: #111827 !important;
    border-color: #9CA3AF !important;
}

.amrs-dt-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 10px;
}

.amrs-dt-bottom .dataTables_info,
.amrs-dt-bottom .dataTables_paginate {
    float: none !important;
    padding-top: 0 !important;
    color: #6B7280 !important;
    font-size: 13px;
}

.amrs-dt-bottom .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin-left: 4px !important;
    border-radius: 6px !important;
    border: 1px solid #E5E7EB !important;
    background: #fff !important;
    color: #374151 !important;
}
.amrs-dt-bottom .dataTables_paginate .paginate_button.current, 
.amrs-dt-bottom .dataTables_paginate .paginate_button:hover {
    background: #EFF6FF !important;
    color: #2563EB !important;
    border-color: #BFDBFE !important;
}

table.dataTable thead th, table.dataTable thead td {
    border-bottom: 2px solid #E5E7EB !important;
}
table.dataTable.no-footer {
    border-bottom: 1px solid #E5E7EB !important;
}

/* ==========================================================================
   SINGLE PROFILE PAGE (MODERN RESPONSIVE REMAKE OF OLD LAYOUT)
   ========================================================================== */

/* --- GENERAL TABLE ADAPTATION (The Magic) --- */
@media (max-width: 768px) {
    /* Скрываем заголовки таблицы на мобилках */
    .amrs-table thead, 
    .amrs-modern-history-table thead {
        display: none;
    }

    /* Превращаем каждую строку в отдельный блок-карточку */
    .amrs-table tbody tr, 
    .amrs-modern-history-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        background: #fff;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* Превращаем каждую ячейку в строку с лейблом */
    .amrs-table tbody td, 
    .amrs-modern-history-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right !important;
        border-bottom: 1px solid #F3F4F6;
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    .amrs-table tbody td:last-child, 
    .amrs-modern-history-table tbody td:last-child {
        border-bottom: none;
    }

    /* Добавляем название колонки из атрибута data-label */
    .amrs-table tbody td::before, 
    .amrs-modern-history-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: #6B7280;
        text-transform: uppercase;
        font-size: 11px;
        flex: 1;
    }
}

/* --- PROFILE HERO SECTION --- */
.amrs-modern-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #374151;
    box-sizing: border-box;
    padding-bottom: 40px;
}

.amrs-modern-wrapper * {
    box-sizing: border-box;
}

.amrs-modern-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .amrs-modern-grid {
        grid-template-columns: 1fr;
    }
}

.amrs-profile-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.amrs-avatar-wrap {
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
}

.amrs-modern-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid #F59E0B;
}

.amrs-player-name {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.amrs-player-bio {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
}

/* Info Chips */
.amrs-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.amrs-info-chip {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    text-align: center;
}

.amrs-info-chip-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    font-weight: 600;
    margin-bottom: 4px;
}

.amrs-info-chip-value {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

/* Rating Boxes */
.amrs-rating-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.amrs-rat-box {
    background: #fff;
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #E5E7EB;
}

.amrs-rat-box-main {
    background: #F59E0B;
    border-color: #F59E0B;
}

.amrs-rat-box-main .amrs-rat-box-label, 
.amrs-rat-box-main .amrs-rat-box-value {
    color: #fff;
}

.amrs-rat-box-label {
    font-size: 11px;
    color: #9CA3AF;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.amrs-rat-box-value {
    font-size: 18px;
    font-weight: 800;
}

.amrs-diff-positive { color: #16A34A; }
.amrs-diff-negative { color: #DC2626; }
.amrs-rat-box-main .amrs-diff-positive, 
.amrs-rat-box-main .amrs-diff-negative { color: #fff; }

/* --- HISTORY SECTION --- */
.amrs-tournament-block {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.amrs-tournament-head {
    background: #F9FAFB;
    padding: 15px 20px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.amrs-tournament-head-title {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.amrs-tournament-head-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.amrs-curr-rat {
    color: #F59E0B;
    font-weight: 800;
}

/* Modern Table Base */
.amrs-modern-history-table {
    width: 100%;
    border-collapse: collapse;
}

.amrs-modern-history-table th {
    background: #fff;
    padding: 12px 15px;
    text-align: left;
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    border-bottom: 2px solid #F3F4F6;
}

.amrs-modern-history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}

.amrs-score-win { color: #16A34A; font-weight: 700; }
.amrs-score-lose { color: #DC2626; font-weight: 700; }

/* Graph Container */
.amrs-modern-graph-container {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    min-width: 0;
    overflow: hidden;
}

.amrs-modern-chart {
    width: 100%;
    min-height: 350px;
}
