:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #e74c3c;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --success: #45A147;
    --warning: #FFD95C;
    --danger: #F5776E;
    --info: #8CC63F;
    --pink: #FABFDD;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f9fc;
    color: var(--dark);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    color: var(--primary);
    font-size: 24px;
    margin-right: 10px;
}

.version {
    background-color: var(--light);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--gray);
}

.search-panel {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 500;
}

.input-group {
    display: flex;
    position: relative;
}

input[type="text"] {
    flex-grow: 1;
    padding: 14px 45px 14px 15px;
    border: 1px solid #dde1e7;
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: var(--light);
    width: 100%;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 18px;
}

.clear-button {
    position: absolute;
    right: 45px; /* Positioned to the left of the search icon */
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 16px;
    cursor: pointer;
    display: none; /* Hidden by default, shown when input has text */
    background: none;
    border: none;
    padding: 0;
    z-index: 2;
}

.clear-button:hover {
    color: var(--secondary);
}

.loading {
    display: none;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

#suggestions {
    position: absolute;
    width: 100%;
    background: white;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: none;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dde1e7;
    border-top: none;
}

.suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.suggestion-item:hover {
    background-color: #f0f7ff;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.percentage-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn i {
    margin-right: 8px;
}

.results-panel {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-card {
    background-color: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    min-height: 120px; /* Ensure consistent height */
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.result-card h3 {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 500;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.result-value a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.result-value a:hover {
    color: var(--primary);
}

.result-value i {
    margin-left: 8px;
    font-size: 16px;
    color: var(--primary);
}

.percentage-result {
    display: flex;
    align-items: center;
    height: 100%;
    margin-top: 5px;
}

.percentage-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin-right: 15px;
    transition: var(--transition);
    padding: 5px;
}

#percentage {
    font-size: 18px;
    display: inline-block;
    margin-right: 2px;
}

#percentage_label {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

/* Style for the data source text */
#data_source {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

/* Style for the last updated timestamp */
#last_updated {
    color: var(--dark);
    font-size: 14px;
}

/* Adjust spacing for the last updated card */
.result-card:last-child .result-value {
    display: flex;
    align-items: baseline;
    padding-top: 5px;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 14px;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.donate-container {
    margin: 20px auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dde1e7;
    max-width: 600px;
}

.donate-message {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--dark);
    font-weight: 500;
}

.donate-button {
    display: inline-flex;
    align-items: center;
    background-color: #0070ba;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.donate-button:hover {
    background-color: #005ea6;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.donate-button i {
    margin-right: 10px;
    font-size: 18px;
}

/* Disclaimer panel styling for footer placement */
footer .disclaimer-panel {
    margin-top: 25px;
    background-color: #f5f5f5;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    border-left: 4px solid var(--info);
    font-size: 13px;
    color: var(--gray);
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

footer .disclaimer-panel p {
    margin: 0;
    line-height: 1.5;
}

footer .disclaimer-panel p:not(:first-child) {
    margin-top: 10px;
}

.privacy-notice {
    margin-top: 10px;
    font-size: 12px;
    color: var(--gray);
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        margin-bottom: 10px;
        justify-content: center;
    }

    .version {
        margin-top: 10px;
    }
}