/**
 * Sports Meister Competitions - Frontend Components
 * Utility components, alerts, loading states, podium display, and accessibility
 *
 * @package Sports_Meister_Competitions
 * @since 1.0.0
 * @requires frontend-core.css
 */

/* Loading State */
.smc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    width: 100%;
    min-height: 200px;
}

/* Spinner deprecated - use progress bar instead */
.smc-spinner {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Messages */
.smc-alert {
    padding: 1.25rem;
    border-radius: var(--smc-border-radius);
    margin: 1rem 0;
    font-size: 1.125rem;
    font-weight: 500;
}

.smc-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid var(--smc-success);
}

.smc-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid var(--smc-danger);
}

.smc-alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 2px solid #17a2b8;
}

/* Notice and Error Messages */
.smc-notice {
    padding: 1rem 1.5rem;
    border-radius: var(--smc-border-radius);
    margin: 1rem 0;
    font-size: 1rem;
}

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

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

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

/* Empty State */
.smc-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--smc-gray-700);
}

.smc-empty-state svg,
.smc-empty-state img {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.smc-empty-state h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--smc-gray-900);
}

.smc-empty-state p {
    font-size: 1.25rem;
    color: var(--smc-gray-700);
}

/* Accessibility */
.smc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Keyboard Navigation */
.smc-btn:focus,
.smc-popup-close:focus,
input:focus,
select:focus,
textarea:focus {
  /*  outline: 3px solid var(--smc-primary);*/
    outline-offset: 2px;
}

/* Competition Lifecycle Status Badges */
.smc-status-badge.smc-badge-draft {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.smc-status-badge.smc-badge-active {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.smc-status-badge.smc-badge-completed {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid var(--smc-success);
}

.smc-status-badge.smc-badge-archived {
    background-color: #e2e3e5;
    color: #383d41;
    border: 2px solid #d6d8db;
}

/* Podium Display */
.smc-podium {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--smc-border-radius);
    box-shadow: var(--smc-box-shadow);
}

.smc-podium-title {
    text-align: center;
    color: var(--smc-primary);
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--smc-primary);
    font-weight: 700;
}

.smc-podium-positions {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-top: 2rem;
}

.smc-podium-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--smc-border-radius);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    flex: 0 0 200px;
}

.smc-podium-position:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.smc-podium-position.smc-position-1 {
    order: 2;
    flex: 0 0 240px;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 3px solid #ffd700;
}

.smc-podium-position.smc-position-2 {
    order: 1;
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border: 3px solid #c0c0c0;
}

.smc-podium-position.smc-position-3 {
    order: 3;
    background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
    border: 3px solid #cd7f32;
}

.smc-podium-rank {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--smc-gray-900);
    margin-bottom: 0.5rem;
}

.smc-position-1 .smc-podium-rank {
    font-size: 1.5rem;
    color: #b8860b;
}

.smc-position-2 .smc-podium-rank {
    color: #6c757d;
}

.smc-position-3 .smc-podium-rank {
    color: #8b4513;
}

.smc-podium-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.smc-position-1 .smc-podium-logo {
    width: 100px;
    height: 100px;
    border-width: 4px;
}

.smc-podium-team {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    color: var(--smc-gray-900);
    line-height: 1.4;
}

.smc-position-1 .smc-podium-team {
    font-size: 1.375rem;
}

.smc-podium-stats {
    font-size: 1rem;
    color: var(--smc-gray-700);
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

.smc-position-1 .smc-podium-stats {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Trophy Icons (optional enhancement) */
.smc-podium-position::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.smc-position-1::before {
    content: '🏆';
    font-size: 2rem;
    top: -20px;
    width: 40px;
    height: 40px;
}

.smc-position-2::before {
    content: '🥈';
    font-size: 1.75rem;
}

.smc-position-3::before {
    content: '🥉';
    font-size: 1.75rem;
}

/* Competition Complete Banner */
.smc-completion-banner {
    background: linear-gradient(135deg, var(--smc-success) 0%, #20c997 100%);
    color: #fff;
    padding: 2rem;
    border-radius: var(--smc-border-radius);
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

.smc-completion-banner h3 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.smc-completion-banner p {
    margin: 0;
    font-size: 1.125rem;
    opacity: 0.95;
}

/* Progress Indicator Enhancement */
.smc-progress-complete .smc-progress-fill {
    background: linear-gradient(90deg, var(--smc-success) 0%, #20c997 100%);
}

/* Login Level / Admin Switch Forms */
.sm-login-switcher-wrap {
    max-width: 560px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.sm-login-switcher-card {
    background: #ffffff;
    border: 1px solid var(--smc-gray-200);
    border-radius: 14px;
    box-shadow: var(--smc-box-shadow);
    padding: 1.5rem;
}

.sm-login-switcher-card-admin {
    border-top: 4px solid var(--smc-primary);
}

.sm-login-switcher-title {
    margin: 0 0 0.35rem;
    color: var(--smc-primary-dark);
    font-size: 1.375rem;
    line-height: 1.3;
}

.sm-login-switcher-subtitle {
    margin: 0 0 1rem;
    color: var(--smc-gray-700);
    font-size: 0.98rem;
}

.sm-login-switcher-form {
    display: grid;
    gap: 0.75rem;
}

.sm-login-switcher-label {
    font-weight: 600;
    color: var(--smc-gray-900);
    font-size: 0.95rem;
}

.sm-login-switcher-select {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--smc-gray-300);
    border-radius: 8px;
    background: #ffffff;
    color: var(--smc-gray-900);
    font-size: 1rem;
}

.sm-login-switcher-select:focus {
    border-color: var(--smc-primary);
    box-shadow: 0 0 0 3px rgba(75, 146, 175, 0.12);
    outline: none;
}

.sm-login-switcher-submit {
    width: 100%;
    min-height: 44px;
}

.sm-login-switcher-card .select2-container {
    width: 100% !important;
}

.sm-login-switcher-card .select2-container .select2-selection--single {
    min-height: 44px;
    border: 1px solid var(--smc-gray-300);
    border-radius: 8px;
}

.sm-login-switcher-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    color: var(--smc-gray-900);
    padding-left: 0.8rem;
}

.sm-login-switcher-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.sm-login-switcher-card .select2-container--default.select2-container--focus .select2-selection--single,
.sm-login-switcher-card .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--smc-primary);
    box-shadow: 0 0 0 3px rgba(75, 146, 175, 0.12);
    padding:0 !important
}
