:root {
    --primary-blue: #4A4AFF;
    --light-blue: #85B5FF;
    --background-color: #f4f7fc;
    --card-bg-color: #ffffff;
    --text-color: #1a202c;
    --light-text-color: #718096;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #dd6b20;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.container {
    max-width: 600px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header img {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

header h1 {
    color: var(--primary-blue);
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
}

header p {
    color: var(--light-text-color);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 74, 255, 0.2);
}

.balance-check {
    display: flex;
    gap: 1rem;
}

.balance-check input {
    flex-grow: 1;
}

.btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover:not(:disabled) {
    background: #3c3cff;
}

.btn:disabled {
    background-color: var(--light-text-color);
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.8rem 1rem;
    width: auto;
    white-space: nowrap;
}

#balance-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--light-text-color);
    height: 30px; /* Reserve space */
    transition: color 0.3s;
}

#balance-display.loaded {
    color: var(--text-color);
}

#status-area {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.status-message {
    padding: 1rem;
    border-radius: 8px;
    display: none; /* Hidden by default */
}

.status-message.success {
    background-color: #e6fffa;
    color: #2c7a7b;
    border: 1px solid #b2f5ea;
}

.status-message.error {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.status-message.warning {
    background-color: #feebc8;
    color: #9c4221;
    border: 1px solid #fbd38d;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-left-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

hr.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

.card h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--primary-blue);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#track-and-catch-btn {
    background-color: var(--light-text-color);
    display: none;
}

#track-and-catch-btn.catchable {
    display: flex;
    background-color: var(--danger-color);
}

#track-and-catch-btn.catchable:hover {
    background-color: #c53030;
}

#countdown-display {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 1.5rem 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tracking-dashboard {
    margin-top: 2rem;
}

#tracking-dashboard h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
    background: var(--card-bg-color);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--light-text-color);
    letter-spacing: 0.05em;
}

td {
    color: var(--text-color);
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.status-TRACKING { background-color: #ebf8ff; color: #3182ce; }
.status-SUCCESS { background-color: #e6fffa; color: #2c7a7b; }
.status-FAILED { background-color: #fff5f5; color: #c53030; }


/* Add these new styles at the end of the file */
.status-TEST_SCHEDULED { background-color: #faf5ff; color: #805ad5; }
.status-TEST_SUCCESS { background-color: #e6fffa; color: #2c7a7b; }
.status-TEST_FAILED { background-color: #fff5f5; color: #c53030; }

.error-details {
    font-size: 0.8rem;
    color: var(--light-text-color);
    margin-top: 0.25rem;
    display: block;
}