@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    --bg-body: #1a1a2e;
    --bg-container: #242933;
    --bg-input-section: #1e2229;
    --bg-input: #3a3f4b;
    --bg-stat-card: #1e2229;
    --header-bg: #2c7cb1;
    --btn-bg: #2980b9;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-input: #f3f4f6;
    --text-link: #00d0ff; 
    --border-color-light: #2c303a;
    --border-color-medium: #4b5563;
    --border-color-focus: #3498db;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-image: var(--background-image-url);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    filter: blur(6px);
    transform: scale(1.05);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: var(--bg-container);
    border-radius: 15px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.header {
    background: var(--header-bg);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.logo { max-width: 190px; height: auto; margin-bottom: 25px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.header h1 { font-size: 2.2em; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.header h4 a { color: white; }
.rate-limiter { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 20px; font-size: 0.9em; backdrop-filter: blur(10px); color: #e0e0e0; }
.rate-limiter #reset-info { color: #a0a0a0; }


.input-section { 
    padding: 30px; 
    background: var(--bg-input-section); 
    border-bottom: 1px solid var(--border-color-light);
}

.input-wrapper { display: flex; flex-direction: column; gap: 20px; width: 100%; margin: 0 auto; }
.input-row { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }

.time-options-row { display: flex; flex-wrap: wrap; gap: 25px; }
.time-option-group { display: flex; align-items: center; gap: 15px; flex: 1 1 300px; }
.time-option-group label { font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.time-option-group select { flex-grow: 1; }
/* Progress Bar Styles */
.progress-container {
    background: var(--bg-input);
    border: 1px solid var(--border-color-medium);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 5px;
}

.progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.progress-percent {
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-bar-track {
    position: relative;
    height: 10px;
    background: var(--bg-input-section);
    border: 1px solid var(--border-color-light);
    border-radius: 999px; /* Pill shape */
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2ecc71, #3498db);
    transition: width 0.2s ease-out;
}

.input-row input[type="text"], .time-option-group select { 
    padding: 12px 16px; 
    border: 2px solid var(--border-color-medium); 
    border-radius: 8px; font-size: 1em; 
    background-color: var(--bg-input); 
    color: var(--text-input); 
    font-family: 'JetBrains Mono', monospace; 
}
.input-row input[type="text"] { flex-grow: 1; min-width: 200px; }

.input-row input:focus, .time-option-group select:focus { 
    outline: none; 
    border-color: var(--border-color-focus); 
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); 
}

.btn { padding: 12px 24px; background: var(--btn-bg); color: white; border: none; border-radius: 8px; font-size: 1em; font-weight: 600; cursor: pointer; transition: all 0.3s ease; position: relative; font-family: 'JetBrains Mono', monospace; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-nav {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.btn-nav:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.content { padding: 30px; }

.player-header { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #295833; color: white; padding: 25px; border-radius: 10px; text-align: center; margin-bottom: 15px; }
.player-name { font-size: 2.2em; font-weight: bold; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.squad-name-wrapper {
    display: flex;
    align-items: center; 
    justify-content: center;
    gap: 15px;
}

.squad-discord-logo { 
    height: 35px;
    width: auto;
    transition: transform 0.2s ease;
}

.squad-discord-logo:hover {
    transform: scale(1.1);
}

/* --- NEW/UPDATED BIO STYLES --- */
.squad-bio { 
    font-size: 1em; 
    color: var(--text-primary);  
    max-width: 1200px; 
    padding-bottom: 10px;
    text-align: left;
}

.squad-bio a {
    color: var(--text-link); 
    text-decoration: none;
    font-weight: 600;
}

.squad-bio a:hover {
    text-decoration: underline;
}

.squad-bio h2 {
    font-size: 1.5em; 
    color: var(--text-primary);
    margin-top: 10px; 
    margin-bottom: 10px; 
    font-weight: 700;
    text-align: center;
    text-shadow: none;
    opacity: 1;
}

.squad-bio hr {
    border: none;
    border-top: 2px solid var(--border-color-medium);
    margin: 20px auto;
    width: 80%;
    max-width: 600px;
}
/* --- END NEW/UPDATED BIO STYLES --- */


.status-badge{ font-weight:600; padding:12px 18px; border-radius:8px; text-align:center; margin-bottom:15px; font-size: 1.1em; }
.status-badge.active{ background:rgba(50,197,110,.15); color:#32c56e; }
.status-badge.inactive{ background:rgba(232,95,95,.15); color:#e85f5f; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: var(--bg-stat-card); border-radius: 10px; padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color-light);
}
.stat-row { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-weight: 600; color: var(--text-secondary); }
.stat-value { font-weight: bold; color: var(--text-primary); font-size: 1.1em; }

.table-wrapper{overflow-x:auto; margin-top: 25px;}
.squad-table{
    width:100%;border-collapse:collapse; font-size:.9rem;
    background: var(--bg-stat-card); border-radius: 10px; overflow: hidden;
}
.squad-table th,.squad-table td{ padding: 14px 16px; border-bottom:1px solid var(--border-color-light); text-align:left; }
.squad-table th{
    background:var(--bg-input-section); color:var(--text-primary);cursor:pointer;position:relative;
    font-weight: 600; text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.5px;
}
.squad-table tbody tr:last-child td { border-bottom: none; }
.squad-table tbody tr:hover{background:rgba(52,152,219,.08);}
.squad-table th.sort-asc::after, .squad-table th.sort-desc::after{
    content:'';position:absolute;right:10px;top:50%;transform:translateY(-50%);
    border:5px solid transparent;
}
.squad-table th.sort-asc::after{border-bottom-color:currentColor;}
.squad-table th.sort-desc::after{border-top-color:currentColor;}
.squad-table td a {
    color: var(--border-color-focus);
    text-decoration: none;
    font-weight: 600;
}
.squad-table td a:hover {
    text-decoration: underline;
}

.footer {
    background: var(--bg-input-section);
    border-radius: 15px;
    padding: 25px 30px;
    margin: 40px auto 0 auto;
    max-width: 900px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.7;
}
.footer p { margin-bottom: 15px; }
.footer p:last-child { margin-bottom: 0; }
.footer strong { color: var(--text-primary); }

@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { padding: 0; }
    .container { border-radius: 0; max-width: 100%; }
    .header { padding-top: 70px; }
    .content { padding: 15px; }
    .header h1, .player-name { font-size: 1.6em; }
    .rate-limiter { position: static; margin-top: 15px; display: inline-block; }
    .input-row { flex-direction: column; align-items: stretch; }
    .time-options-row { flex-direction: column; align-items: stretch; gap: 20px; }
    .time-option-group { flex-direction: column; align-items: stretch; gap: 8px; flex-basis: auto; }
    .time-option-group label { text-align: left; }
    .time-option-group select { flex-grow: 0; }

    .stats-grid { grid-template-columns: 1fr; }
}