/* 
 * SITE.CSS - GLOBAL STYLES ONLY
 * 
 * IMPORTANT: This file should ONLY contain truly global styles.
 * Component-specific styles should be placed in their own CSS files
 * and properly scoped with component-specific class prefixes.
 * 
 * See /docs/CSS_BEST_PRACTICES.md for guidelines on CSS organization.
 *
 * Global variables should be defined in darktheme.css with --theme- prefix.
 * Legacy variables are kept here temporarily for backward compatibility.
 */


/* Markdown Content Styling */
.blockquote img,
.card-text img,
.markdown-rendered img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure all markdown content stays within its container */
.markdown-rendered,
blockquote p,
.card-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Apply responsive styling to images in all contexts */
img {
    max-width: 100%;
    height: auto;
}


/* Logo specific styling */
.logo-img,
.navbar-brand img {
    width: auto !important;
    height: 60px !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    transform: none !important;
    max-width: none !important;
}

/* Current Series Bag Tag Styles */
.current-user-bag-tag {
    border-radius: 8px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.05);
}

.current-user-bag-tag h6 {
    font-weight: 600;
    color: var(--text-primary);
}

/* Small bag tag in the widget */
.current-user-bag-tag .bag-tag-container {
    max-width: 180px;
    margin: 0 auto;
    transform: scale(0.9);
}

[data-bs-theme="dark"] {
    .current-user-bag-tag {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .current-user-bag-tag h6 {
        color: var(--theme-text-primary, #e2e8f0);
    }
}

:root {
    /* Base font sizes - should be moved to darktheme.css and renamed --theme-base-font-* */
    --base-font-size-small: 14px;
    --base-font-size-large: 16px;
    /* Note: --text-primary, --text-secondary, --text-muted are defined in darktheme.css */
}

html {
    font-size: var(--base-font-size-small);
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: var(--base-font-size-large);
    }
}

.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


.badge {
    font-size: 0.9em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.equal-height-row {
    display: flex;
    flex-wrap: wrap;
}

.equal-height-col {
    display: flex;
    flex-direction: column;
}

.equal-height-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.equal-height-card .card-body {
    flex: 1;
}


/* Tee Time Accordion Styles */
.accordion-button {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.accordion-button.collapsed {
    position: relative;
}


/* Player cards and tee time styles - see consolidated versions below */

.open-slot {
    border: 2px dashed var(--border-color, #ccc);
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    color: var(--text-secondary, #666);
    background: var(--surface-2, #f9f9f9);
    transition: all 0.3s ease;
}

button.open-slot:hover {
    background: var(--surface-3, #f0f0f0);
    border-color: var(--border-color, #999);
    color: var(--text-primary, #333);
    transform: scale(1.02);
}

.open-slot i {
    margin-right: 8px;
}

/* Player info/image styles - see consolidated versions below */

.player-pdga, .player-location, .player-rating {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    text-align: center;
}

.player-location {
    margin-top: -10px;
}

/* Indicator colors - using Bootstrap CSS variables */
.buy-in {
    background-color: var(--bs-success, #28a745);
}

.ace-pot {
    background-color: var(--bs-warning, #ffc107);
}

.ctp {
    background-color: var(--bs-info, #17a2b8);
}

.super-ace {
    background-color: var(--bs-danger, #dc3545);
}

/* Styles specific to the confirmation page */
.hero-section {
    background-color: var(--surface-2, #f8f9fa);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}


/* .choose-tee-time styles - see consolidated version below */


.accordion-button.selected {
    background-color: rgba(var(--bs-success-rgb), 0.15);
    color: var(--bs-success);
}

.accordion-button.selected::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23198754' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
}

.accordion-button.selected .selected-text {
    margin-left: 10px;
    font-weight: bold;
}

/* Add responsive breakpoints if needed */
@media (max-width: 992px) {
    .player-card {
        width: calc(50% - 0.5rem);
    }
}

@media (max-width: 576px) {
    .player-card {
        width: 100%;
    }

    .player-info {
        flex-direction: column;
    }
}


/* .initials-circle styles - see consolidated version below */

.countdown-timer {
    font-size: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    color: var(--bs-success, #28a745);
}


.noUi-handle {
    border: none;
    background: none;
    box-shadow: none;
    width: 40px !important;
    height: 40px !important;
    right: -20px !important;
    top: -15px !important;
    cursor: grab;
}

.noUi-handle:active {
    cursor: grabbing;
}

.noUi-handle::before,
.noUi-handle::after {
    display: none;
}

.noUi-handle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.noUi-target {
    height: 10px;
    border: none;
    box-shadow: none;
}

.noUi-base {
    background: #e0e0e0;
}

.noUi-connect {
    transition: background 450ms;
}



#bagTagCarousel .carousel-item {
    padding: 20px;
}

#bagTagCarousel .card {
    height: 100%;
    transition: transform 0.2s;
}

#bagTagCarousel .card:hover {
    transform: scale(1.05);
}

#bagTagCarousel .carousel-control-prev,
#bagTagCarousel .carousel-control-next {
    width: 5%;
    background-color: rgba(0, 0, 0, 0.2);
}

#bagTagCarousel .carousel-control-prev-icon,
#bagTagCarousel .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px;
}

@media (max-width: 768px) {
    #bagTagCarousel .carousel-item .row {
        flex-direction: column;
    }

    #bagTagCarousel .carousel-item {
        padding-bottom: 50px;
    }
}

/* Enhanced animations */
@keyframes shine {
    0% {
        background-position: -100px;
    }
    100% {
        background-position: 300px;
    }
}

.scrollable-players {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
}

.scrollable-players::-webkit-scrollbar {
    width: 6px;
}

.scrollable-players::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.scrollable-players::-webkit-scrollbar-thumb {
    background-color: #6c757d;
    border-radius: 3px;
}


/* Bootstrap default overrides removed - use Bootstrap utilities or component-specific styles */

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .container {
        padding: 0.5rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
    }
}


/* Global dropdown z-index fixes */
.dropdown-menu {
    z-index: 1060 !important;
    /* Force the dropdown to break out of parent stacking contexts */
    transform: none !important;
    /* Ensure dropdown isn't clipped by overflow property */
    filter: none !important;
    will-change: transform;
}

/* Global Button Contrast Fixes
   Ensure anchors styled as buttons inherit the button text color, avoiding
   blue-on-green or other low-contrast states caused by default link colors. */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn:visited {
    /* Use button text color rather than default link colors */
    color: inherit !important;
    text-decoration: none !important;
}

/* Also ensure common child elements inside buttons inherit the correct color */
.btn .btn-text,
.btn i,
.btn span {
    color: inherit !important;
}

/* Explicit anchor-button color rules for strong contrast */
/* Enforce high-contrast text on solid color buttons (anchors or buttons) */
.btn-primary,
.btn-success,
.btn-danger,
.btn-info,
.btn-secondary,
.btn-dark,
a.btn-primary,
a.btn-success,
a.btn-danger,
a.btn-info,
a.btn-secondary,
a.btn-dark {
    color: #ffffff !important;
}

a.btn-warning,
a.btn-light,
.btn-warning,
.btn-light {
    color: #111111 !important;
}

/* Theme button variants */
a.btn-theme-base.btn-theme-primary,
a.btn-theme-base.btn-theme-accent {
    color: var(--league-primary-text, #ffffff) !important;
}

/* Fix for Bootstrap 5 dropdown positioning */
.dropdown-menu[data-bs-popper] {
    margin-top: 0.125rem !important;
}

/* Special fix for dropdowns inside cards */
.card .dropdown-menu {
    position: absolute !important;
    /* Ensure the dropdown isn't clipped by the card */
    inset: auto !important;
    transform: none !important;
}

.dropdown-toggle-split {
    z-index: 1060;
}

/* Active dropdown toggle state for better contrast */
.dropdown-toggle.show,
.btn.show {
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.1)) !important;
    border-color: var(--color-primary, #007bff) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dark mode active dropdown state */
[data-bs-theme="dark"] .dropdown-toggle.show,
[data-bs-theme="dark"] .btn.show,
.dark-mode .dropdown-toggle.show,
.dark-mode .btn.show {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--color-primary, #818cf8) !important;
    color: var(--color-primary, #818cf8) !important;
}

.btn-group {
    position: relative;
    z-index: 1060;
    display: inline-flex;
    vertical-align: middle;
    flex-wrap: nowrap;
    align-items: stretch;
}

/* Ensure buttons in groups stay together */
.btn-group > .btn,
.btn-group > .dropdown {
    position: relative;
    flex: 0 1 auto;
    white-space: nowrap;
}

/* Prevent button groups from breaking */
.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

/* Dropdown toggle split specific styling */
.btn-group > .dropdown-toggle-split {
    padding-right: 0.5rem !important;
    padding-left: 0.5rem !important;
    min-width: auto !important;
    max-width: 2.5rem !important;
    flex: 0 0 auto !important;
}

.btn-group > .dropdown-toggle-split::after {
    margin-left: 0;
}

/* Ensure proper 80/20 split for button groups */
.btn-group > .btn:first-child:not(:last-child) {
    flex: 1 1 auto !important;
    min-width: 0;
}

/* Make cards use auto z-index to avoid creating new stacking contexts */
.card {
    position: relative;
    z-index: auto;
    /* Prevent cards from creating new stacking contexts that trap dropdowns */
    transform: none !important;
    filter: none !important;
    overflow: visible !important;
}

/* Fix for FAQ and JOIN THE BETA buttons */
.navbar .btn-info,
.navbar .btn-warning {
    color: inherit !important;
    text-decoration: none !important;
}

.navbar .btn-info {
    background-color: var(--bs-info, #0dcaf0) !important;
    border-color: var(--bs-info, #0dcaf0) !important;
    color: #fff !important;
}

.navbar .btn-warning {
    background-color: var(--bs-warning, #ffc107) !important;
    border-color: var(--bs-warning, #ffc107) !important;
    color: #000 !important;
}

[data-bs-theme="dark"] {
    .navbar .btn-info {
        color: #fff !important;
    }

    .navbar .btn-warning {
        color: #000 !important;
    }

    /* Dark mode for team containers */

    .team-container {
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .team-header {
        background: var(--league-primary, #0d6efd);
    }

    .team-players {
        background: var(--surface-1, #1e293b);
    }
}

/* Mobile-Friendly Form Controls */
@media (max-width: 768px) {
    /* Prevent zoom on focus for iOS */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="search"],
    textarea,
    select,
    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents iOS zoom */
        -webkit-appearance: none; /* Remove default iOS styling */
    }

    /* Ensure inputs are full width on mobile */
    .input-group {
        width: 100%;
    }

    .input-group .form-control {
        width: 100%;
        min-width: 0; /* Prevent overflow */
    }

    /* Stack input groups vertically on small screens */
    .input-group-lg {
        flex-direction: column;
    }

    .input-group-lg .input-group-text {
        width: 100%;
        border-radius: 0.5rem 0.5rem 0 0 !important;
    }

    .input-group-lg .form-control {
        border-radius: 0 !important;
    }

    .input-group-lg .btn {
        width: 100%;
        border-radius: 0 0 0.5rem 0.5rem !important;
    }
}

/* PDGA Links - Global Animated Underline Effect */
a[href*="pdga.com/player/"] {
    position: relative;
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Light mode link colors */
@media (prefers-color-scheme: light) {
    a[href*="pdga.com/player/"] {
        color: #0066cc;
    }

    a[href*="pdga.com/player/"]:hover {
        color: #0099ff;
    }
}

/* Dark mode link colors */
[data-bs-theme="dark"] {
    a[href*="pdga.com/player/"] {
        color: #66b3ff;
    }

    a[href*="pdga.com/player/"]:hover {
        color: #99ccff;
    }
}

/* Animated underline using pseudo-element */
a[href*="pdga.com/player/"]::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background: linear-gradient(90deg, #0066cc 0%, #0099ff 50%, #0066cc 100%);
    background-size: 200% 100%;
    transition: width 0.3s ease, left 0.3s ease;
    animation: pdga-shimmer 2s ease-in-out infinite;
    animation-play-state: paused;
}

/* Dark mode underline gradient */
[data-bs-theme="dark"] {
    a[href*="pdga.com/player/"]::after {
        background: linear-gradient(90deg, #66b3ff 0%, #99ccff 50%, #66b3ff 100%);
    }
}

/* Hover state animation */
a[href*="pdga.com/player/"]:hover::after {
    width: 100%;
    left: 0;
    animation-play-state: running;
}

/* Shimmer animation for the underline */
@keyframes pdga-shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Active/clicking state */
a[href*="pdga.com/player/"]:active {
    color: #0055aa;
    transform: translateY(1px);
}

/* Focus state for accessibility */
a[href*="pdga.com/player/"]:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

[data-bs-theme="dark"] {
    a[href*="pdga.com/player/"]:focus {
        outline-color: #66b3ff;
    }
}


/* Global Modal Z-Index Fix
   Ensures all modals appear above the navigation header (z-index: 1060-1100) */
.modal {
    z-index: 1200 !important;
}

.modal-backdrop {
    z-index: 1190 !important;
}

/* Ensure modal dialogs are properly stacked */
.modal-dialog {
    z-index: 1210 !important;
}

/* Fix for any custom modals that might use different classes */
.modal.show {
    z-index: 1200 !important;
}

/* Ensure tooltips and popovers in modals are above everything */
.modal .tooltip {
    z-index: 1220 !important;
}

.modal .popover {
    z-index: 1220 !important;
}

/* Fix for nested modals (if any) */
.modal .modal {
    z-index: 1230 !important;
}

.modal .modal-backdrop {
    z-index: 1220 !important;
}

/* Helper: responsive skins badge assets for wide and inline placements */
.skins-badge {
    display: block;
    max-width: 100%;
    height: auto;
}

.skins-badge--card {
    max-width: 320px;
}

.skins-badge--inline {
    display: inline-block;
    max-height: 1.25rem;
    height: auto;
    width: auto;
    vertical-align: middle;
}
