/* Tournament Management Styles */
:root {
    --stm-primary: #0073aa;
    --stm-primary-dark: #005a87;
    --stm-success: #28a745;
    --stm-warning: #ffc107;
    --stm-danger: #dc3545;
    --stm-light: #f8f9fa;
    --stm-dark: #343a40;
    --stm-border: #dee2e6;
    --stm-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --stm-radius: 8px;
    --stm-transition: all 0.3s ease;
}

.stm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.stm-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: var(--stm-radius);
    box-shadow: var(--stm-shadow);
}

.stm-form-container h2 {
    text-align: center;
    color: var(--stm-primary);
    margin-bottom: 30px;
    font-size: 2em;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--stm-dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--stm-border);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--stm-transition);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--stm-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--stm-danger);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.2);
}

/* Buttons */
.stm-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--stm-transition);
    line-height: 1.5;
}

.stm-btn-primary {
    background: var(--stm-primary);
    color: white;
}

.stm-btn-primary:hover {
    background: var(--stm-primary-dark);
    transform: translateY(-1px);
}

.stm-btn-success {
    background: var(--stm-success);
    color: white;
}

.stm-btn-warning {
    background: var(--stm-warning);
    color: var(--stm-dark);
}

.stm-btn-danger {
    background: var(--stm-danger);
    color: white;
}

.stm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stm-btn-full {
    width: 100%;
}

/* Dashboard Navigation */
.dashboard-nav {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: #fff;
    border-radius: var(--stm-radius);
    box-shadow: var(--stm-shadow);
    overflow: hidden;
}

.nav-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: var(--stm-transition);
}

.nav-btn:hover {
    background: var(--stm-light);
    color: var(--stm-primary);
}

.nav-btn.active {
    color: var(--stm-primary);
    border-bottom-color: var(--stm-primary);
    background: var(--stm-light);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.event-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--stm-radius);
    box-shadow: var(--stm-shadow);
    border-left: 5px solid var(--stm-primary);
    transition: var(--stm-transition);
    position: relative;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.event-card h3 {
    margin: 0 0 15px 0;
    color: var(--stm-primary);
    font-size: 1.3em;
}

.event-card p {
    margin: 10px 0;
    color: #666;
    line-height: 1.5;
}

.event-card strong {
    color: var(--stm-dark);
}

.event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--stm-border);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--stm-radius);
    box-shadow: var(--stm-shadow);
    text-align: center;
    border-top: 4px solid var(--stm-primary);
    transition: var(--stm-transition);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--stm-primary);
    margin: 0;
}

.stat-label {
    color: #666;
    margin: 10px 0 0 0;
    font-weight: 500;
}

/* Messages */
.stm-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

.stm-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.stm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stm-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.stm-info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

/* Tables */
.stm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: var(--stm-radius);
    overflow: hidden;
    box-shadow: var(--stm-shadow);
}

.stm-table th,
.stm-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--stm-border);
}

.stm-table th {
    background: var(--stm-light);
    font-weight: 600;
    color: var(--stm-dark);
    font-size: 14px;
}

.stm-table tr:hover {
    background: #f8f9fa;
}

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

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-full {
    background: #e2e3e5;
    color: #495057;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--stm-border);
    border-top: 4px solid var(--stm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search and Filters */
.stm-search-bar {
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid var(--stm-border);
    border-radius: 25px;
    font-size: 14px;
    transition: var(--stm-transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--stm-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Notifications */
.stm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.stm-notification.stm-success {
    background: var(--stm-success);
}

.stm-notification.stm-error {
    background: var(--stm-danger);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .stm-container {
        padding: 15px;
    }
    
    .stm-form-container {
        margin: 10px;
        padding: 20px;
    }
    
    .dashboard-nav {
        flex-direction: column;
    }
    
    .nav-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-btn.active {
        border-left-color: var(--stm-primary);
        border-bottom-color: transparent;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .event-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .stm-table {
        font-size: 14px;
    }
    
    .stm-table th,
    .stm-table td {
        padding: 10px;
    }
    
    .stm-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    .checkbox-group {
        gap: 8px;
    }
    
    .event-card {
        padding: 20px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2em;
    }
}

/* Print Styles */
@media print {
    .dashboard-nav,
    .stm-btn,
    .nav-btn,
    .stm-notification {
        display: none !important;
    }
    
    .event-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .stm-table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --stm-light: #2d3748;
        --stm-dark: #f7fafc;
        --stm-border: #4a5568;
    }
    
    body {
        background: #1a202c;
        color: #f7fafc;
    }
    
    .stm-form-container,
    .event-card,
    .stat-card,
    .stm-table,
    .dashboard-nav {
        background: #2d3748;
        color: #f7fafc;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #4a5568;
        color: #f7fafc;
        border-color: #718096;
    }
}