/* --- 1. CORE VARIABLES & BASE --- */
:root {
    --bg-dark: #0f172a;
    --card-dark: #1e293b;
    --border-dark: #22344e;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-gold: #fbbf24;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --bg-nav: #1e293b;
}

body {
    margin: 0;
   font-family: "Lato", sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
	overscroll-behavior-y: contain;
	overflow-x: hidden;
}

/* Add this utility class */
.hidden {
    display: none !important;
}
.box-1 {background: var(--accent-green);
    padding: 5px 3px 3px 3px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 11px;
    font-weight: 700;
	
}
.status-final {font-size: 12px;}
.status-live {
	font-size: 12px;
	display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-bottom: 0px;
}
.purse-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 10px;
}
.purse-label {
    font-weight: 700;
}
.purse-sub {
    font-size: 12px;
    line-height: 30px;
	 color: var(--text-muted);
}
.purse-amount {
    display: flex;
    flex: 1;
    text-align: right;
    justify-content: end;
    font-size: 24px;
    font-weight: 700;
}
.fa-chevron-right.chevron { color: var(--text-muted) !important;}
    .login-body {
            background-color: var(--bg-main);
  			display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
		 min-height: 70vh;
   
    flex-direction: column;
  
    background-color: var(--bg-dark);
        }

        .login-wrapper {
            width: 100%;
            max-width: 380px;
            padding: 20px;
        }

       

        .logo-circle {
            width: 70px;
            height: 70px;
            background: rgba(212, 175, 55, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px auto;
            border: 1px solid rgba(212, 175, 55, 0.2);
        }

        /* Seamless Input Group */
        .input-group-seamless {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border-dark);
            border-radius: 8px;
            margin-bottom: 15px;
            padding: 0 15px;
            transition: all 0.3s ease;
			 display: flex;
    align-items: center;
    background: transparent !important;
        }

        /* Focus state for the entire wrapper */
        .input-group-seamless:focus-within {
            border-color: var(--accent-gold);
            box-shadow: 0 0 0 1px var(--accent-gold);
            background: rgba(255, 255, 255, 0.05);
        }

        .input-group-seamless i {
            color: var(--text-muted);
            font-size: 1rem;
            margin-right: 12px;
            width: 20px;
            text-align: center;
        }

        .input-group-seamless input {
            background: transparent !important;
			 background-color: transparent !important;
            border: none !important;
			 outline: none !important;
    box-shadow: none !important;
            color: white !important;
            padding: 14px 0 !important;
            width: 100%;
            outline: none !important;
            font-size: 0.95rem;
        }

        .input-group-seamless input::placeholder {
            color: rgba(255, 255, 255, 0.3);
        }
/* Container styling */


/* The actual input field */

.input-group-seamless input:-webkit-autofill,
.input-group-seamless input:-webkit-autofill:hover, 
.input-group-seamless input:-webkit-autofill:focus {
    /* Stop the browser from painting its own background */
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    
    /* Force the text color to stay white */
    -webkit-text-fill-color: #ffffff !important;
    
    /* Ensure the background is transparent */
    background-color: transparent !important;
    
    /* Set a transition to "lock" the style in place indefinitely */
    transition: background-color 5000s ease-in-out 0s;
}
.input-group-seamless input:-webkit-autofill,
.input-group-seamless input:-webkit-autofill:hover, 
.input-group-seamless input:-webkit-autofill:focus, 
.input-group-seamless input:-webkit-autofill:active {
 -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
  -webkit-text-fill-color: #ffffff !important;
   transition: background-color 5000s ease-in-out 0s;
}

/* Optional: Highlight the bottom border instead of the background on focus */

        .alert-error {
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid rgba(239, 68, 68, 0.2);
            font-size: 0.85rem;
            margin-bottom: 20px;
        }

        .btn-gold-full {
            width: 100%;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.95rem;
            margin-top: 10px;
        }
/* Ensure your header is set to flex */

/* USER AREA - HEADER RIGHT */
.user-area { 
    display: flex; 
    align-items: center; /* This centers everything vertically */
    gap: 12px; 
    cursor: pointer; 
 
    border-radius: 30px; 
    transition: background 0.2s;
    height: 100%; /* Ensures it fills the header height for a better hit area */
}

.header-username { 
    font-weight: 600; 
    font-size: 0.9rem; 
    color: var(--text-main); 
    line-height: 1; /* Prevents text leading from pushing the name down */
     display: block; 
}

/* Ensure the avatar has no stray margins */
.header-avatar, .avatar-sm {
    display: block;
    margin: 0;
}

/* Logo Styling */
.header-logo-svg {
    height: 32px; /* Adjust based on your SVG dimensions */
    width: auto;
    display: block;
}

/* Ensure Logo area aligns nicely */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
}

/* Mobile Navigation Icons */
.tab-btn i {
    font-size: 1.1rem;
}
/* --- HORIZONTAL NAVIGATION --- */
.dropdown-box {padding: 5px; background:rgba(255,255,255,0.03); margin: 10px 0px; border-radius: 12px;}
.data-table .dropdown-box th {padding: 12px 12px 12px 12px; background: none;}
.nav-row-container {
  
 
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
	overscroll-behavior: none;
    touch-action: pan-x;
	 border-bottom: 3px solid var(--border-dark);
   
}

.nav-center {
    display: flex;
    flex-direction: row; /* Forces horizontal */
    align-items: center;
    justify-content: space-around; /* Distributes evenly on mobile */
    max-width: 100%; /* Constrains width so buttons don't fly apart on wide screens */
    margin: 0 auto;
    height: 48px;
    padding: 0 10px;
}

.tab-btn {
    display: flex;
    flex-direction: row; /* Icon next to text */
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 1; 
	text-transform: uppercase;
}

.tab-btn i {
    font-size: 1rem;
}

.tab-btn.active {
    color: var(--accent-gold);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
.flex-gap-10.myteam {gap: 10px;}
.margTop5 {margin-top: 5px;}
/* Update Form Elements */
.dark-input, .dark-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    color: white;
	width: 100%;
    padding: 12px 15px; /* Slightly more padding for the "no label" look */
    border-radius: 6px; /* Matching the .btn class */
    font-size: 14px;
    transition: border-color 0.2s;
}

.dark-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Styling the Placeholder specifically */
.dark-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

/* Remove any specific margin-bottom from old labels */
.input-label {
    display: none;
}


/* Ensure the footer pushes to the bottom if the page is taller than the screen */

/* Auth Card specifics */
.auth-card {
    width: 90%;
    max-width: 90%;
    margin: auto; /* Keeps it centered within the flex container */
    background: var(--card-dark);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-dark);
}

.pulse {width: 10px;  height: 10px;  display: inline-block;  margin-right: 5px;}
.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h2 {
    margin: 10px 0 0 0;
    color: var(--text-main);
    font-size: 1.8rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
/* --- FOOTER STYLES --- */
.app-footer {
	 width: 100%;
    margin-top: auto; 
   
    padding: 15px 0;
    color: var(--text-muted);
	
}

.app-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.app-footer strong {
    color: var(--accent-gold);
}
/* --- 2. LAYOUT UTILITIES --- */
.container { max-width: 100%; margin: 0 auto; }
.container-wide { max-width: 100%; }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-10 { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- 3. REUSABLE COMPONENTS --- */

/* Cards */
.dark-card {
  
    color: white;
    
   
    padding: 20px;
   
}
.avatar-edit-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

.avatar-edit-wrapper:hover .avatar-overlay {
    opacity: 1; /* Shows on hover */
}

/* Ensure the big avatar stays circular */
.avatar-lg {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid var(--border-dark);
}
.timestamp {font-size: 10px;  color: var(--text-muted) !important; }
.card-header {
    margin: 0 0 15px 0;
    color: var(--accent-gold);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 15px;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    margin-bottom: 1rem;
}
.tour-left {line-height: 0px;}
.t-logo-small {
    width: 75px;
    height: 75px;
    object-fit: contain;
    border-radius: 50%;
   
}
.tour-right {padding-left: 24px; display: flex; flex-direction: column;}
.t-title {
	font-size: 19px;
    margin: 6px 0px 8px 0px;
}
.tourn-status {font-size: 14px;}
.course {font-size: 12px; }
/* Ensure data tables don't collapse too much */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.data-table tr {border-bottom: 1px solid var(--border-dark); color: #e2e8f0;}
.data-table tr:last-child {border-bottom: none;}
.data-table tr.user-row:not(:has(~ .user-row)) {border-bottom: none;}
.data-table tr.dropdown-row:not(:has(~ .dropdown-row)) {border-top: 1px solid var(--border-dark);}
.data-table tr.hist-row:not(:has(~ .hist-row)) {border-top: 1px solid var(--border-dark);}

.data-table td { padding: 12px;  }
.data-table tr:hover {  }
.data-table .dropdown-box th.text-center, .data-table.jingle th.text-center {text-align: center;}
/* Form Elements */
.dark-input, .dark-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
}
.input-full { width: 100%; box-sizing: border-box; }

/* Buttons */
.btn { border: none; padding: 8px 16px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.btn-blue { background: var(--accent-blue); color: white; }
.btn-gold { background: var(--accent-gold); color: var(--bg-dark); width: 100%; padding: 12px; margin-top: 20px; }
.btn-red { background: var(--accent-red); color: white; width: 100%;}
.btn-green { background: var(--accent-green); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border-dark); color: var(--text-muted); }

/* --- 4. NAVIGATION & HEADER --- */
.app-header {
  
    padding: 0 15px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  overscroll-behavior: none;
}
 .nav-row-container, 
.app-header {
    /* Prevents vertical pull-to-refresh gestures from starting on these elements */
    touch-action: pan-x; 
    /* Disables the browser's native 'bounce' effect at the top of these elements */
    overscroll-behavior: none; 
} 
.ptr--ptr {
    pointer-events: none !important; /* Prevents the refresh box from stealing clicks */
}
#ptr-content {
   
    /* This ensures the pull-to-refresh logic has a valid container to pull down */
    position: relative;
    z-index: 1;
}
.nav-row-container, 
.app-header,
.tab-btn {
    touch-action: manipulation; /* Only allows standard taps and double-taps */
    -webkit-overflow-scrolling: auto; /* Stops elastic bounce on iOS */
}

.nav-row-container, 
.app-header {
    overscroll-behavior-y: none !important;
    touch-action: pan-x !important; /* Only allow horizontal movement */
    position: relative;
    z-index: 10002; /* Ensure it stays above the PTR text layer */
}

/* Hide the PTR text if it tries to peek through behind the nav */
.ptr--ptr {
    z-index: 1; /* Move it behind the nav bar */
    pointer-events: none; /* Make it unclickable */
}
.font600 {font-weight: 500;}
/* --- 5. SHARED AVATAR/GOLFER STYLES --- */
.avatar { border-radius: 50%; object-fit: cover; border: 1px solid #475569;  }
.avatar-sm { width: 30px; height: 30px; }
.avatar-md { width: 36px; height: 36px; }
.avatar-lg { width: 100px; height: 100px; border-width: 3px; }

.flag-icon { width: 18px; height: auto; border-radius: 2px; }

/* --- 6. SPECIFIC VIEW HELPERS --- */
.tab-pane { display: none; animation: fadeIn 0.3s ease;}
.tab-pane.active { display: block; }

.rank-badge { padding: 2px 6px; border-radius: 4px; font-weight: bold; font-size: 12px; }
.rank-gold { background: var(--accent-gold); color: black; }
.rank-silver { background: #cbd5e1; color: var(--bg-dark); }

.alert-box { padding: 10px; border-radius: 6px; font-weight: bold; text-align: center; margin: 15px 0; }

.pulse { height: 8px; width: 8px; background: var(--accent-green); border-radius: 50%; animation: pulse-anim 2s infinite; }

/* --- 7. TYPOGRAPHY & COLORS --- */
.text-red { color: var(--accent-red) !important; }
.text-green { color: var(--accent-green) !important; }
.text-gold { color: var(--accent-gold) !important; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: bold; }
.text-center { text-align: center; }
/* --- PLAYER SELECTION GRID --- */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
	margin-top: 15px;
    padding-right: 5px;
}
.player-submit {margin-top: 15px;}

.player-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.player-card:hover {
    background: var(--card-dark);
    border-color: #60a5fa;
    color: var(--text-main);
}

.player-card.active-card {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--accent-blue);
    color: var(--text-main);
    font-weight: bold;
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.icon-holder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}
.dropdown-row {
    display: none;
}

.chevron {
    transition: transform 0.2s ease;
    display: inline-block; /* Required for transform to work on icons */
    width: 12px;
    text-align: center;
}
/* --- TOURNAMENT HEADER WITH BG IMAGE --- */

.tourney-bg-wrapper {
    position: relative;
    padding: 0 !important; /* Remove card padding to let gradient hit edges */
    overflow: hidden;
    background-size: cover;
    background-position: center;
    min-height: 150px; /* Ensures enough of the image shows */
    display: flex !important; /* Keep it flex whenever it IS visible */
    flex-direction: column;
    justify-content: flex-end;
}

.tourney-content-gradient {
    width: 100%;
    /* Gradient from solid dark at bottom to transparent at top */
    background: linear-gradient(to top, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(15, 23, 42, 0.7) 50%, 
        rgba(15, 23, 42, 0) 100%);
    padding: 25px 20px 20px 20px; /* Padding for the text inside */
    box-sizing: border-box;
}

/* Specific adjustment for the Event Logo so it doesn't look weird on the background */
.t-img-overlay {
    width: 100px;
    height: auto;
    border-radius: 4px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

/* Ensure title pops off the image background */

/* --- TOURNAMENT LOGO STYLE --- */
.dropdown-box span {font-size: 12px;}
.data-table.myteamPage th.text-center, .data-table th.text-center.alignCenter {text-align: center;}

/* Reset title margin to work with the flex container */
.data-table th.center-align {text-align: center;}

/* Alignment helper for the logo and title */
.t-left .flex-gap-10 {
    display: flex;
    align-items: center;
    gap: 15px;
}
.tourney-flex { flex-direction: row; display: flex; align-items: center; }
/* --- 8. ANIMATIONS & QUERIES --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-anim { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

@media(max-width: 768px) {
    
    .grid-2-col { grid-template-columns: 1fr; }
    .desktop-only { display: none; }
	.logo-area .desktop-only {display:none;}
	.tab-btn span {font-size: 11px;}
}
@media (min-width: 768px) {
	   .header-username { 
      
    } 
    .nav-center {
        gap: 20px;
    }
    
    .tab-btn {
        flex: 0 1 auto; /* Buttons only take as much space as they need on desktop */
        font-size: 0.95rem;
        padding: 8px 20px;
    }
}
@media (max-width: 480px) {
	.data-table .dropdown-box th.fixPad {padding: 12px 5px;}
	.img-hide img.avatar, .standings .dropdown-box .avatar  {display: none;}
	
	.standings .avatar {width: 24px; height: 24px;}
	.data-table th, .data-table td {padding: 8px 5px;}
	.data-table td.thru-tee {padding: 8px 2px;}
	.flex-gap-10 {gap: 5px;}
	.flex-gap-10.addSpace {gap: 10px;}
    .tab-btn i {
        font-size: 1.3rem;
        margin: 0;
    }
	.font12 {font-size: 12px;}
	.font14 {font-size: 14px;}
}
@media (max-width: 400px) {
    /* On tiny screens, hide text to keep icons horizontal and prevent wrapping */
    
    .tab-btn i {
        font-size: 1.2rem;
    }
}
/* Hide text on very small screens to keep nav clean */
