/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-link: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d2991d;
    --purple: #a371f7;
    --button-bg: #238636;
    --button-hover: #2ea043;
    --card-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 40px 20px 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-link);
}

header h1 i {
    margin-right: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== Search Section ===== */
.search-section {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 10px;
}

#usernameInput {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}

#usernameInput:focus {
    border-color: var(--text-link);
}

#usernameInput::placeholder {
    color: var(--text-secondary);
}

#checkButton {
    padding: 12px 30px;
    font-size: 1rem;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    white-space: nowrap;
}

#checkButton:hover {
    background-color: var(--button-hover);
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Loading Spinner ===== */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--text-link);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ===== Error Message ===== */
.error {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* ===== Stats Cards ===== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.stat-card i {
    font-size: 2.5rem;
}

.stat-card.followers i { color: var(--text-link); }
.stat-card.following i { color: var(--green); }
.stat-card.not-following-back i { color: var(--yellow); }
.stat-card.snakes i { color: var(--red); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Results Section ===== */
.results-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.tab:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    color: var(--text-link);
    border-bottom: 2px solid var(--text-link);
    background-color: var(--bg-tertiary);
}

.tab-content {
    padding: 20px;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--bg-tertiary);
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.profile-link {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
}

.profile-link:hover {
    text-decoration: underline;
}

.unfollow-btn {
    padding: 6px 15px;
    background-color: var(--red);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.unfollow-btn:hover {
    background-color: #da3633;
}

.snake-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(248, 81, 73, 0.2);
    color: var(--red);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Snake Alert ===== */
.snake-alert {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--red);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
}

.snake-alert i {
    font-size: 1.5rem;
}

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--green);
}

.empty-state p {
    font-size: 1.2rem;
}

/* ===== Info Section ===== */
.info-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-link);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.step {
    text-align: center;
    padding: 20px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--button-bg);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.step p {
    color: var(--text-secondary);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--text-link);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #checkButton {
        width: 100%;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab.active {
        border-bottom: 2px solid var(--text-link);
    }
}