/* Add these to your existing style.css or a new stats-specific CSS file */

.header-link {
    color: inherit; /* Inherit color from parent */
    text-decoration: none; /* Remove underline */
}

#stats-url-form { /* Similar to #url-form */
    display: flex;
    gap: 1rem;
}
#short-url-input { /* Similar to #url-input */
    flex-grow: 1;
    font-size: 1rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border: 1px solid #444;
    border-radius: 50px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#short-url-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.25);
}
#short-url-input:invalid { /* Style for invalid pattern */
    border-color: #cf6679; /* Error color */
}

#get-stats-btn { /* Similar to #generate-btn */
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#get-stats-btn:hover {
    background-color: var(--primary-variant);
    color: #fff;
}
#get-stats-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#stats-result-container {
    margin-top: 3rem;
    padding: 1.5rem; /* Slightly less padding than QR result */
    background-color: var(--surface-color);
    border-radius: 16px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.stats-header h2 {
    color: var(--text-color);
    font-size: 1.4rem;
    margin-right: 1rem; /* Space before period selector */
    word-break: break-all;
}
.period-selector {
    display: flex;
    align-items: center;
}
.period-selector label {
    margin-right: 0.5rem;
    color: var(--text-muted-color);
}
#period-select {
    padding: 0.5rem 0.8rem;
    background-color: var(--bg-color); /* Darker than surface */
    border: 1px solid #444;
    color: var(--text-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 1.5rem;
}

.stats-card {
    background-color: var(--bg-color); /* Darker than surface */
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.stats-card h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}
.stats-card p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.stats-card strong {
    color: var(--text-muted-color);
}

.stats-card-full-width {
    grid-column: 1 / -1; /* Make this card span full width */
}

.stats-list {
    list-style: none;
    padding-left: 0;
}
.stats-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #2a2a2a; /* Very subtle separator */
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}
.stats-list li:last-child {
    border-bottom: none;
}
.stats-list .score {
    color: var(--text-muted-color);
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.change-indicator.positive {
    color: #4caf50; /* Green */
}
.change-indicator.negative {
    color: #f44336; /* Red */
}

#click-chart-container {
    min-height: 250px; /* Placeholder height */
    display: flex;
    align-items: center;
    justify-content: center;
}
.raw-data-display { /* For preformatted text */
    background-color: #000;
    padding: 10px;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8em;
    width: 100%;
}
/* Add to your CSS */
.chart-interval-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#chart-interval-select {
    padding: 0.4rem 0.7rem;
    background-color: var(--bg-color);
    border: 1px solid #444;
    color: var(--text-color);
    border-radius: 5px;
    font-size: 0.85rem;
}
/* Add these to your existing style.css */

/* Pill Selector Styles */
.pill-selector-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem; /* Add some space if multiple groups */
    flex-wrap: wrap; /* Allow pills to wrap on small screens */
}

.pill-label {
    color: var(--text-muted-color);
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.pill-container {
    display: flex;
    gap: 0.5rem; /* Space between pills */
    flex-wrap: wrap;
}

button.pill-button { /* Style buttons to look like pills */
    background-color: var(--surface-color);
    color: var(--text-muted-color);
    border: 1px solid #444;
    padding: 0.4rem 0.9rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

button.pill-button:hover {
    background-color: #333; /* Slightly lighter surface */
    border-color: #555;
    color: var(--text-color);
}

button.pill-button.active {
    background-color: var(--primary-color);
    color: var(--bg-color); /* Or a very light text color for contrast */
    border-color: var(--primary-color);
    font-weight: 700;
}

/* Adjustments for stats header layout with pills */
.stats-header {
    /* flex-direction: column; /* Stack title and period selector on small screens if needed */
    /* align-items: flex-start; */
    gap: 0.5rem; /* Space between title and period pills group */
}

.period-selector { /* This class was for the old dropdown, can be removed or repurposed */
    /* display: flex;
    align-items: center; */
}
/* Ensure .chart-interval-selector is styled if it's still a class on the div */
.chart-interval-selector {
    margin-bottom: 1rem; /* Keep space above chart */
}

/* Update input placeholder text color if needed */
#short-url-input::placeholder {
    color: var(--text-muted-color);
    opacity: 0.7;
}