/* ================================================================
   TOURNAMENTS CSS - Dashboard Theme
   ================================================================ */

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes orbFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-14px) rotate(10deg);
    }
}

@keyframes livePulse {
    0%, 100% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.delay-100 {
    animation-delay: 0.1s;
}
.delay-200 {
    animation-delay: 0.2s;
}
.delay-300 {
    animation-delay: 0.3s;
}

/* ================================================================
   HERO BANNER (Dashboard Style)
   ================================================================ */
.tr-hero-banner {
    position: relative;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    border-radius: 24px;
    padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 52px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.45);
}

.tr-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.tr-hero-content {
    max-width: 680px;
    position: relative;
    z-index: 2;
}

.tr-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.tr-pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 12px #22c55e;
    animation: livePulse 1.8s infinite ease-in-out;
}

.tr-hero-title {
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1.2;
}

.tr-hero-title span {
    background: linear-gradient(135deg, #fde047, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tr-hero-subtitle {
    font-size: clamp(14px, 1.6vw, 17px);
    opacity: 0.92;
    margin: 0 0 24px;
    line-height: 1.6;
}

.tr-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    cursor: pointer;
}

.tr-btn-primary {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.tr-btn-primary:hover {
    background: #f8fafc;
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.tr-btn-glass {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tr-btn-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.tr-hero-graphic {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.tr-cricket-orb {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    color: #fde047;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: orbFloat 4s ease-in-out infinite alternate;
}

/* ================================================================
   SECTION TITLE
   ================================================================ */
.tr-section-title {
    margin-bottom: 20px;
}

.tr-section-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tr-section-title h2 i {
    color: #4f46e5;
}

.tr-section-title p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* ================================================================
   TOURNAMENTS CARD
   ================================================================ */
.tr-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: all 0.3s ease;
}

.tr-card:hover {
    border-color: #a855f7;
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.08);
}

.tr-card-body {
    padding: 0;
}

/* ================================================================
   TABLE
   ================================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tr-table thead th {
    text-align: left;
    padding: 16px 24px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid #e2e8f0;
}

.tr-table tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
    color: #0f172a;
    transition: background 0.2s;
}

.tr-table tbody tr:last-child td {
    border-bottom: none;
}

.tr-table tbody tr:hover td {
    background: #fafbfc;
}

.text-right {
    text-align: right !important;
}

/* Tournament Name */
.tr-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
}

.tr-location {
    color: #64748b;
    font-size: 13px;
}

.tr-overs {
    font-weight: 600;
    color: #4f46e5;
}

.tr-teams {
    font-weight: 600;
}

/* Status Badge */
.tr-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tr-status-active {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.tr-status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    animation: livePulse 1.8s infinite ease-in-out;
}

/* Action Cell */
.tr-action-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.tr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.tr-action-manage {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.tr-action-manage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    color: #fff;
}

.tr-action-menu {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tr-action-menu:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

/* ================================================================
   DROPDOWN MENU
   ================================================================ */
.tr-dropdown-menu {
    display: none;
    position: fixed;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    width: 200px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 6px;
    animation: fadeIn 0.15s ease-out;
}

.tr-dropdown-menu.show {
    display: block;
}

.tr-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: 0.15s;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background: transparent;
    width: 100%;
}

.tr-dropdown-item:hover {
    background: #f8fafc;
    color: #4f46e5;
}

.tr-dropdown-item i {
    font-size: 16px;
}

.tr-dropdown-item.tr-delete {
    color: #ef4444;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.tr-dropdown-item.tr-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.tr-empty-state {
    padding: 60px 24px;
    text-align: center;
    color: #64748b;
    display: none;
}

.tr-empty-icon {
    width: 72px;
    height: 72px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #94a3b8;
    margin: 0 auto 16px;
}

.tr-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}

.tr-empty-state p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* ================================================================
   MODALS
   ================================================================ */
.tr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tr-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.tr-modal {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 35px 70px -15px rgba(15, 23, 42, 0.4);
    padding: 0;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tr-modal-overlay.show .tr-modal {
    transform: translateY(0) scale(1);
}

.tr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.tr-modal-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tr-modal-header h2 i {
    color: #4f46e5;
}

.tr-modal-close {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tr-modal-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.tr-modal-sub {
    margin: 4px 28px 20px;
    font-size: 13px;
    color: #94a3b8;
}

.tr-form-group {
    padding: 0 28px;
    margin-bottom: 16px;
}

.tr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.tr-form-group input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
}

.tr-form-group input:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.tr-modal-actions {
    display: flex;
    gap: 10px;
    padding: 8px 28px 28px;
}

.tr-btn-secondary {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tr-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tr-btn-primary-full {
    flex: 2;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tr-btn-primary-full:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-2px);
}

.tr-btn-primary-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Delete Modal */
.tr-modal-delete {
    text-align: center;
    padding: 32px 28px 28px;
}

.tr-delete-icon {
    width: 70px;
    height: 70px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: #ef4444;
}

.tr-delete-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.tr-delete-text {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 24px;
}

.tr-delete-actions {
    display: flex;
    gap: 10px;
}

.tr-btn-danger {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    background: #ef4444;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tr-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 991px) {
    .tr-hero-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 28px 24px;
    }
    .tr-hero-graphic {
        align-self: center;
    }
    .tr-cricket-orb {
        width: 80px;
        height: 80px;
        font-size: 38px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 14px 12px;
    }

    .tr-hero-banner {
        padding: 18px 16px;
        border-radius: 16px;
        margin-bottom: 18px;
    }
    .tr-hero-badge {
        font-size: 11px;
        padding: 4px 12px;
    }
    .tr-hero-title {
        font-size: 20px;
    }
    .tr-hero-subtitle {
        font-size: 12.5px;
        margin-bottom: 16px;
    }
    .tr-btn {
        padding: 8px 16px;
        font-size: 12.5px;
        border-radius: 10px;
    }

    .tr-section-title h2 {
        font-size: 16px;
    }
    .tr-section-title p {
        font-size: 12px;
    }

    .tr-card {
        border-radius: 16px;
    }

    /* Hide Desktop Columns */
    .tr-table thead {
        display: none;
    }

    .tr-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .tr-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        border-radius: 14px;
        padding: 16px;
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
        position: relative;
        transition: transform 0.2s ease;
    }

    .tr-table tbody tr:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(79, 70, 229, 0.35);
    }

    .tr-table tbody tr:hover td {
        background: transparent !important;
    }

    .tr-table tbody td {
        display: block;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        color: #ffffff !important;
        width: 100%;
        text-align: left !important;
    }

    /* Name & Meta */
    .tr-table tbody td:first-child {
        order: 1;
        width: 100%;
        padding-right: 80px !important;
    }

    .tr-name {
        font-size: 16px;
        color: #ffffff !important;
        margin-bottom: 6px;
    }

    .tr-meta-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 4px;
    }

    .tr-meta-tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 10px;
        font-weight: 600;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.25);
        padding: 3px 10px;
        border-radius: 6px;
        backdrop-filter: blur(4px);
    }

    .tr-meta-tag i {
        font-size: 12px;
    }

    /* Status */
    .tr-table tbody td:nth-child(5) {
        order: 2;
        position: absolute;
        top: 14px;
        right: 14px;
        width: auto !important;
    }

    .tr-status-badge {
        font-size: 9px;
        padding: 3px 10px;
        background: rgba(34, 197, 94, 0.2);
        color: #86efac;
        border: 1px solid rgba(34, 197, 94, 0.3);
    }

    .tr-status-active::before {
        width: 5px;
        height: 5px;
    }

    /* Actions */
    .tr-table tbody td:last-child {
        order: 3;
        margin-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        padding-top: 14px !important;
    }

    .tr-action-cell {
        justify-content: flex-start !important;
        width: 100%;
    }

    .tr-action-manage {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(4px);
        box-shadow: none;
    }

    .tr-action-manage:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
        box-shadow: none;
    }

    .tr-action-menu {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.15);
        padding: 10px 14px;
        border-radius: 10px;
    }

    .tr-action-menu:hover {
        background: rgba(255, 255, 255, 0.25);
        color: #ffffff;
    }

    /* Hidden desktop columns */
    .tr-table tbody td:nth-child(2),
    .tr-table tbody td:nth-child(3),
    .tr-table tbody td:nth-child(4) {
        display: none;
    }

    /* Modal Mobile */
    .tr-modal {
        max-width: 100%;
        border-radius: 16px;
    }
    .tr-modal-header {
        padding: 20px 20px 0;
    }
    .tr-modal-header h2 {
        font-size: 18px;
    }
    .tr-modal-sub {
        margin: 4px 20px 16px;
        font-size: 12px;
    }
    .tr-form-group {
        padding: 0 20px;
        margin-bottom: 14px;
    }
    .tr-modal-actions {
        padding: 8px 20px 20px;
        flex-direction: column;
    }
    .tr-btn-secondary,
    .tr-btn-primary-full {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .tr-cricket-orb {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    .tr-name {
        font-size: 14px;
    }
    .tr-meta-tag {
        font-size: 9px;
        padding: 2px 8px;
    }
    .tr-action-manage {
        font-size: 12px;
        padding: 8px;
    }
}

/* ================================================================
   SKELETON LOADER
   ================================================================ */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent !important;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}