/* Tournament Manager Styles */

.tm-tournament-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.tm-tournament-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .tm-tournament-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tm-tournament-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .tm-tournament-grid {
        grid-template-columns: 1fr;
    }
}

.tm-tournament-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.tm-tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tm-card-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.tm-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

.tm-card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.tm-card-status {
    background: #4caf50;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.tm-card-content {
    padding: 15px;
}

.tm-card-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.tm-card-meta {
    margin-bottom: 15px;
}

.tm-meta-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.tm-meta-label {
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.tm-meta-value {
    color: #333;
}

.tm-meta-item.tm-prize {
    color: #ff9800;
    font-weight: 600;
}

.tm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.tm-card-organizer {
    font-size: 12px;
    color: #999;
}

.tm-card-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.tm-card-link:hover {
    text-decoration: underline;
}

.tm-load-more-container {
    text-align: center;
    margin: 40px 0;
}

.tm-load-more-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tm-load-more-btn:hover {
    background: #5568d3;
}

.tm-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tm-loading-spinner {
    display: inline-block;
    margin-right: 10px;
}

/* Modal Styles */
.tm-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tm-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: none;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tm-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.tm-modal-close:hover,
.tm-modal-close:focus {
    color: #000;
}

.tm-no-tournaments {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

/* Widget Styles */
.tm-widget-tournaments {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tm-widget-tournament-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.tm-widget-tournament-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tm-widget-cover {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 10px;
}

.tm-widget-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-widget-content h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.tm-widget-content h4 a {
    color: #333;
    text-decoration: none;
}

.tm-widget-content h4 a:hover {
    color: #667eea;
}

.tm-widget-date,
.tm-widget-prize,
.tm-widget-organizer {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.6;
}

.tm-widget-prize {
    color: #ff9800;
    font-weight: 600;
}

.tm-widget-footer {
    margin-top: 15px;
    text-align: center;
}

.tm-widget-more-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.tm-widget-more-link:hover {
    text-decoration: underline;
}

/* Form Styles */
.tm-tournament-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tm-form-group {
    margin-bottom: 20px;
}

.tm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tm-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.tm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .tm-form-row {
        grid-template-columns: 1fr;
    }
}

.tm-upload-btn {
    margin-top: 10px;
}

.tm-image-preview {
    margin-top: 10px;
}

.tm-image-preview img {
    max-width: 300px;
    border-radius: 5px;
}

.tm-form-submit {
    margin-top: 30px;
}

.tm-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.tm-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.tm-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Tournament Detail Styles */
.tm-tournament-detail {
    padding: 20px 0;
}

.tm-detail-header {
    margin-bottom: 30px;
}

.tm-detail-cover {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tm-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-detail-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #333;
}

.tm-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tm-detail-section {
    margin: 30px 0;
}

.tm-detail-section h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.tm-detail-section p {
    line-height: 1.8;
    color: #666;
}

/* Team Styles */
.tm-teams-section {
    margin-top: 40px;
}

.tm-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tm-team-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.tm-team-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tm-team-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.tm-team-members {
    margin: 15px 0;
}

.tm-team-member {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 5px;
    font-size: 14px;
}

.tm-team-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.tm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tm-btn-primary {
    background: #667eea;
    color: white;
}

.tm-btn-primary:hover {
    background: #5568d3;
}

.tm-btn-secondary {
    background: #6c757d;
    color: white;
}

.tm-btn-secondary:hover {
    background: #5a6268;
}

