/**
 * Tournament Plugin Enhanced Styles
 * Global enhancements for all tournament templates
 *
 * @package dyat
 * @since 2.0.0
 */

/* ===================================
   Global Tournament Styles
   =================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Container improvements */
.trn-container,
.container {
    position: relative;
}

/* ===================================
   Buttons & Links
   =================================== */

.trn-button,
.trn-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    display: inline-block;
    text-decoration: none;
}

.trn-button:hover,
.trn-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    color: #fff;
}

.trn-button:active,
.trn-btn:active {
    transform: translateY(-1px);
}

.trn-button-sm {
    padding: 8px 20px;
    font-size: 13px;
}

.trn-button-lg {
    padding: 16px 40px;
    font-size: 16px;
}

/* ===================================
   Cards & Panels
   =================================== */

.trn-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.trn-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.trn-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 25px;
    font-weight: normal;
    font-size: 18px;
}

.trn-card-body {
    padding: 25px;
}

/* ===================================
   Tables
   =================================== */

.trn-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
}

.trn-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.trn-table thead th {
    padding: 18px 15px;
    text-align: left;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.trn-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.trn-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
}

.trn-table tbody td {
    padding: 15px;
}

.trn-table tbody td a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.trn-table tbody td a:hover {
    color: #764ba2;
}

.trn-table-striped tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* ===================================
   Badges & Status
   =================================== */

.trn-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trn-badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.trn-badge-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.trn-badge-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.trn-badge-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

/* ===================================
   Progress Bars
   =================================== */

.trn-progress {
    height: 25px;
    background: #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.trn-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: normal;
    font-size: 12px;
}

.trn-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ===================================
   Tabs & Navigation
   =================================== */

.trn-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.trn-nav-item {
    flex: 1;
}

.trn-nav-link {
    display: block;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-weight: normal;
    transition: all 0.3s ease;
}

.trn-nav-link:hover,
.trn-nav-link.trn-nav-active {
    background: #fff;
    color: #667eea;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===================================
   Forms & Inputs
   =================================== */

.trn-form-control {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.trn-form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.trn-form-group {
    margin-bottom: 20px;
}

.trn-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* ===================================
   Modals & Overlays
   =================================== */

.trn-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.trn-modal.active {
    opacity: 1;
    pointer-events: all;
}

.trn-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.trn-modal.active .trn-modal-content {
    transform: scale(1);
}

/* ===================================
   Tooltips
   =================================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* ===================================
   Animations
   =================================== */

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation utility classes */
.animate-fadeIn {
    animation: fadeIn 0.6s ease;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease;
}

.animate-zoomIn {
    animation: zoomIn 0.6s ease;
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}

.animate-bounce {
    animation: bounce 2s ease infinite;
}

/* ===================================
   Utility Classes
   =================================== */

.trn-text-center {
    text-align: center;
}

.trn-text-left {
    text-align: left;
}

.trn-text-right {
    text-align: right;
}

.trn-mb-1 { margin-bottom: 0.5rem; }
.trn-mb-2 { margin-bottom: 1rem; }
.trn-mb-3 { margin-bottom: 1.5rem; }
.trn-mb-4 { margin-bottom: 2rem; }
.trn-mb-5 { margin-bottom: 3rem; }

.trn-mt-1 { margin-top: 0.5rem; }
.trn-mt-2 { margin-top: 1rem; }
.trn-mt-3 { margin-top: 1.5rem; }
.trn-mt-4 { margin-top: 2rem; }
.trn-mt-5 { margin-top: 3rem; }

.trn-p-1 { padding: 0.5rem; }
.trn-p-2 { padding: 1rem; }
.trn-p-3 { padding: 1.5rem; }
.trn-p-4 { padding: 2rem; }
.trn-p-5 { padding: 3rem; }

/* ===================================
   Responsive Utilities
   =================================== */

@media (max-width: 768px) {
    .trn-nav {
        flex-direction: column;
    }

    .trn-table {
        font-size: 14px;
    }

    .trn-card-body {
        padding: 15px;
    }

    .trn-modal-content {
        padding: 20px;
    }
}

/* ===================================
   Dark Mode Support (Optional)
   =================================== */

@media (prefers-color-scheme: dark) {
    .trn-card {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }

    .trn-table {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }

    .trn-table tbody tr {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .trn-form-control {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* ===================================
   Loading Spinner
   =================================== */

.trn-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.trn-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
