/**
 * USTA API Integration Styles
 * Enhanced tournament display and registration functionality
 */

/* USTA Badge */
.usta-badge {
    position: static;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    align-self: flex-start;
}

.usta-badge i {
    font-size: 14px;
}

/* Enhanced Tournament Cards */
.tournament-card {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tournament-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: #0a5566;
}

.tournament-card[data-usta-id] {
    border-left: 4px solid #3b82f6;
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.tournament-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
    flex: 1;
}

.tournament-date {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.tournament-details {
    margin-bottom: 25px;
}

.tournament-detail {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
    color: #555;
}

.tournament-detail i {
    width: 20px;
    margin-right: 12px;
    color: #0a5566;
    font-size: 16px;
}

.tournament-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tournament-actions-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.tournament-actions-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Registration Status Indicators */
.registration-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.registration-status.open {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.registration-status.closed {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.registration-status.full {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #0a5566 0%, #0d6efd 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 85, 102, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 85, 102, 0.4);
    color: white;
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: #0a5566;
    border: 2px solid #0a5566;
}

.btn-outline:hover {
    background: #0a5566;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn-secondary:disabled {
    background: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0a5566;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 20px;
}

.notification-success .notification-content i {
    color: #10b981;
}

.notification-error .notification-content i {
    color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Authentication Status */
.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.auth-status.authenticated {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.auth-status.unauthenticated {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.auth-status i {
    font-size: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tournament-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .tournament-title {
        font-size: 20px;
        padding-right: 80px;
    }
    
    .tournament-date {
        font-size: 14px;
    }
    
    .usta-badge {
        position: static;
        margin-top: 10px;
        align-self: flex-start;
    }
    
    .tournament-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tournament-actions-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Tournament Status Indicators */
.tournament-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.tournament-status.open {
    background: #d1fae5;
    color: #065f46;
}

.tournament-status.closed {
    background: #fee2e2;
    color: #991b1b;
}

.tournament-status.full {
    background: #fef3c7;
    color: #92400e;
}

/* Enhanced Tournament Grid */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .tournaments-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* USTA Integration Specific Styles */
.usta-integration {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px 0;
    border-radius: 10px;
    margin: 20px 0;
}

.usta-integration-header {
    text-align: center;
    margin-bottom: 30px;
}

.usta-integration-header h3 {
    color: #1e3a8a;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 10px;
}

.usta-integration-header p {
    color: #64748b;
    font-size: 16px;
}

/* Registration Form Enhancements */
.registration-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.registration-form h4 {
    color: #0a5566;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0a5566;
    box-shadow: 0 0 0 3px rgba(10, 85, 102, 0.1);
}

/* Payment Modal Styles */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.payment-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.payment-header h3 {
    color: #0a5566;
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-payment {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-payment:hover {
    background: #f3f4f6;
    color: #374151;
}

.payment-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.payment-amount {
    font-size: 24px;
    color: #0a5566;
    text-align: center;
    margin-bottom: 15px;
}

.payment-info {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.payment-info p {
    margin: 5px 0;
}

.payment-form {
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0a5566;
    box-shadow: 0 0 0 3px rgba(10, 85, 102, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Payment Processing Styles */
.payment-processing {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.payment-processing h4 {
    color: #0a5566;
    margin-bottom: 15px;
}

.payment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.payment-detail {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.payment-detail strong {
    display: block;
    color: #374151;
    margin-bottom: 5px;
}

.payment-detail span {
    color: #6b7280;
    font-size: 14px;
}

/* Mobile Payment Modal */
@media (max-width: 768px) {
    .payment-modal-content {
        padding: 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .payment-amount {
        font-size: 20px;
    }
}
