/* matches.css - Стили для раздела матчей */

/* Заголовок и действия */
.matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}


.team-cards {
    display: inline-flex;
    gap: 4px;
    margin: 0;
    position: static;
    transform: none;
    flex: 0 0 auto;
}

/* базовая карточка */
.card {
    width: 12px;
    height: 18px;
    border-radius: 3px;
    display: inline-block;

    transform: rotate(-8deg);
}

/* жёлтая */
.yellow-card {
    background: #fbc02d;
}

/* красная */
.red-card {
    background: #d32f2f;
}


.matches-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    width: 100%;
}

#addMatchBtn,
.matches-filter {
    width: 100%;
}

#addMatchBtn {
    text-align: center;
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 0.9rem;
    height: 40px;
}

/* Сводная статистика */
.matches-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-green);
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-white);
    margin-bottom: 5px;
}

.summary-label {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Список матчей */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-item {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-item:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.match-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.match-item.win::before {
    background: #4CAF50;
}

.match-item.draw::before {
    background: #FFA500;
}

.match-item.loss::before {
    background: #F44336;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.match-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 20px;
    row-gap: 8px;
    flex: 1;
}

.team {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.match-teams > .team:nth-of-type(1) {
    grid-column: 1;
    grid-row: 1;
}

.match-teams > .team:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
}

.team-logo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-black);
    padding: 5px;
}

.team-name {
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.15;
    color: var(--primary-white);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
    text-align: center;
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.team-name-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-name.has-cards {
    padding: 0;
    gap: 6px;
}

.team-name.has-cards-left {
    flex-direction: row-reverse;
}

.team-name.has-cards-right {
    flex-direction: row;
}

.match-meta-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 2px;
    margin-bottom: 2px;
}

.match-meta-date,
.match-meta-competition {
    color: var(--secondary-text);
    font-size: 0.85rem;
    line-height: 1.2;
}

.match-meta-competition {
    font-weight: 600;
}

.match-center {
    display: contents;
}

.match-venue {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    display: inline-block;
}

.match-score {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-white);
    padding: 0 20px;
    position: relative;
}

.match-score::before,
.match-score::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 2px;
    background: var(--border-color);
}

.match-score::before {
    right: 100%;
}

.match-score::after {
    left: 100%;
}

.match-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.match-date {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.match-result {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.match-result.win {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.match-result.draw {
    background: rgba(255, 165, 0, 0.1);
    color: #FFA500;
}

.match-result.loss {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

.match-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.match-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--secondary-text);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-action-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-white);
    background: rgba(76, 175, 80, 0.1);
}

/* Статистика матча */
.match-stats {
    background: var(--primary-black);
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.match-stats-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-white);
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.match-stats-title i {
    color: var(--primary-green);
}

.match-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.match-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--secondary-black);
    border-radius: 8px;
    border-left: 4px solid;
}

.match-stat-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.match-stat-goal .match-stat-icon {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.match-stat-assist .match-stat-icon {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.match-stat-card .match-stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
}

.match-stat-minutes .match-stat-icon {
    background: rgba(103, 58, 183, 0.1);
    color: #673AB7;
}

.match-stat-name {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.match-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-white);
}

.match-stat-goal {
    border-left-color: #4CAF50;
}

.match-stat-assist {
    border-left-color: #3498db;
}

.match-stat-card {
    border-left-color: #FFC107;
}

.match-stat-minutes {
    border-left-color: #673AB7;
}

/* Форма матча */
.match-form-modal {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 800px;
    margin: 0 auto;
    animation: slideIn 0.3s ease;
}

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

.match-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.match-form-header h3 {
    color: var(--primary-white);
    margin: 0;
    font-size: 1.3rem;
}

.close-form-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-form-btn:hover {
    color: var(--primary-white);
}

.match-form {
    padding: 25px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    color: var(--primary-white);
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h4 i {
    color: var(--primary-green);
}

/* Ввод команд и счета */
.teams-input {
    --teams-input-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 20px;
    margin: 20px 0;
}

.team-input {
    flex: 1;
    min-width: 0;
}

.team-input .form-control,
.score-field {
    height: var(--teams-input-height);
}

.score-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    align-self: end;
}

.score-field {
    width: 70px;
    padding: 0 10px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.score-separator {
    color: var(--primary-white);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Сетка статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.form-group.quarter {
    margin-bottom: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .matches-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .matches-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .matches-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .match-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .match-teams {
        grid-template-columns: 1fr;
        row-gap: 12px;
        column-gap: 0;
    }

    .match-teams > .team:nth-of-type(1),
    .match-teams > .team:nth-of-type(2),
    .match-score,
    .match-venue {
        grid-column: 1;
        grid-row: auto;
        justify-self: center;
    }

    .match-teams > .team:nth-of-type(1),
    .match-teams > .team:nth-of-type(2) {
        width: 100%;
    }

    .match-details {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .teams-input {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .match-form {
        padding: 15px;
    }
    
    .match-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half,
    .form-group.quarter {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .match-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
}

/* Анимации */
.match-item {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--secondary-text);
}

.empty-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--primary-white);
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 25px;
}

.card-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.card-checkbox.yellow i {
    color: #FFD700;
}

.card-checkbox.red i {
    color: #FF0000;
}

.card-checkbox.muted {
    opacity: 0.5;
    cursor: not-allowed;
}

.match-notes {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}
