/**
 * Padel Tournament Pro - Public Styles
 * Version: 1.2.0
 */

/* ========================================
   GENERAL PUBLIC STYLES
======================================== */

.padel-tournaments-container,
.padel-tournament-single,
.padel-registration-form-container,
.padel-bracket-display {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ========================================
   TOURNAMENT LIST
======================================== */

.tournaments-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Tournament Grid */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.tournament-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.tournament-thumbnail {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f8f9fa;
}

.tournament-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.tournament-card:hover .tournament-thumbnail img {
    transform: scale(1.05);
}

.tournament-thumbnail .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-open {
    background: #28a745;
    color: #fff;
}

.badge-full {
    background: #dc3545;
    color: #fff;
}

.badge-closed {
    background: #6c757d;
    color: #fff;
}

.tournament-content {
    padding: 20px;
}

.tournament-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.tournament-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

.tournament-title a:hover {
    color: #007bff;
}

.tournament-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.meta-item .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.meta-item .time {
    margin-left: 5px;
    font-weight: 500;
}

.meta-item.price {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
}

.tournament-excerpt {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.tournament-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.button-primary {
    background: #007bff;
    color: #fff;
}

.button-primary:hover {
    background: #0056b3;
    color: #fff;
}

.button-secondary {
    background: #6c757d;
    color: #fff;
}

.button-secondary:hover {
    background: #5a6268;
    color: #fff;
}

.button-disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.button-large {
    padding: 12px 24px;
    font-size: 16px;
}

.no-tournaments {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-style: italic;
}

/* ========================================
   SINGLE TOURNAMENT PAGE
======================================== */

.padel-tournament-single {
    max-width: 1200px;
    margin: 0 auto;
}

.tournament-header {
    position: relative;
    margin-bottom: 40px;
}

.tournament-featured-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tournament-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tournament-header-content {
    text-align: center;
}

.tournament-header-content .tournament-title {
    font-size: 36px;
    margin: 0 0 15px 0;
}

.tournament-header-content .badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.tournament-body {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.tournament-section {
    background: #fff;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 30px;
}

.tournament-section h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.tournament-description {
    font-size: 16px;
    line-height: 1.8;
    color: #495057;
}

.registrations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.registration-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.registration-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

.team-name {
    font-weight: 600;
    color: #212529;
}

.team-players {
    font-size: 14px;
    color: #6c757d;
}

/* Sidebar */
.tournament-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.sidebar-widget {
    background: #fff;
    padding: 25px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f3f5;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.info-label .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: #007bff;
}

.info-value {
    font-size: 15px;
    color: #212529;
}

.info-value.time,
.info-value.address,
.info-value.spots {
    font-size: 13px;
    color: #6c757d;
}

.info-value.price {
    font-size: 20px;
    font-weight: 600;
    color: #28a745;
}

.registration-cta {
    text-align: center;
}

.registration-cta .button {
    width: 100%;
}

/* ========================================
   REGISTRATION FORM
======================================== */

.padel-registration-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.padel-registration-form {
    background: #fff;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.padel-registration-form h3,
.padel-registration-form h4 {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 600;
    color: #212529;
}

.padel-registration-form h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group .required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

.players-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.player-group {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
}

.player-group:last-child {
    margin-bottom: 0;
}

.payment-info {
    background: #e7f5ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin: 20px 0;
}

.payment-info h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.payment-info strong {
    color: #007bff;
}

.form-check label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
}

.form-check input[type="checkbox"] {
    margin-top: 3px;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions .button {
    min-width: 200px;
}

.registration-messages {
    margin-top: 20px;
}

/* ========================================
   BRACKET DISPLAY
======================================== */

.padel-bracket-display {
    background: #fff;
    padding: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.no-bracket-notice {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Knockout Bracket */
.bracket-knockout {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 20px 0;
}

.bracket-round {
    min-width: 280px;
    flex-shrink: 0;
}

.round-title {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
}

.round-matches {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.match-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

.match-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.1);
}

.match-card.completed {
    border-color: #28a745;
    background: #f1f9f3;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.team.winner {
    background: #d4edda;
    border: 2px solid #28a745;
    font-weight: 600;
}

.team-name {
    flex: 1;
}

.team-score {
    font-weight: 600;
    color: #212529;
}

.match-vs {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
}

.match-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
}

/* Round Robin Bracket */
.bracket-round-robin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.rr-group {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.group-title {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
}

.group-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.team-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #007bff;
    color: #fff;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.group-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-item.completed {
    border-left: 3px solid #28a745;
}

.match-item .vs {
    color: #6c757d;
    font-weight: 600;
}

.match-item .result {
    margin-left: auto;
    font-weight: 600;
    color: #007bff;
}

/* Rotation Bracket */
.bracket-rotation {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.rotation-round {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.rotation-round .round-title {
    text-align: left;
    margin-bottom: 20px;
}

.rotation-round .round-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.rotation-round .match-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.court-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-result {
    text-align: center;
    font-weight: 600;
    color: #007bff;
    margin-top: 10px;
}

/* ========================================
   NOTICES
======================================== */

.padel-notice,
.notice {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

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

.notice-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ========================================
   RESPONSIVE
======================================== */

@media screen and (max-width: 992px) {
    .tournament-body {
        grid-template-columns: 1fr;
    }
    
    .tournament-sidebar {
        position: static;
    }
    
    .tournaments-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .bracket-knockout {
        flex-direction: column;
    }
    
    .bracket-round {
        min-width: 100%;
    }
    
    .bracket-round-robin {
        grid-template-columns: 1fr;
    }
    
    .rotation-round .round-matches {
        grid-template-columns: 1fr;
    }
    
    .tournament-featured-image {
        height: 250px;
    }
    
    .tournament-header-content .tournament-title {
        font-size: 28px;
    }
}
