:root {
    /* Light mode variables */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --accent-color: #1da1f2;
    --accent-hover: #0c85d0;
    --glow-color: rgba(29, 161, 242, 0.2);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --border-color: #e1e8ed;
    --error-color: #e0245e;
    --success-color: #17bf63;
    --chart-colors: #1da1f2, #17bf63, #794bc4, #f45d22;
}

.dark-mode {
    /* Dark mode variables */
    --bg-primary: #15202b;
    --bg-secondary: #192734;
    --text-primary: #ffffff;
    --text-secondary: #8899a6;
    --accent-color: #1da1f2;
    --accent-hover: #0c85d0;
    --glow-color: rgba(29, 161, 242, 0.3);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --border-color: #38444d;
    --error-color: #e0245e;
    --success-color: #17bf63;
    --chart-colors: #1da1f2, #17bf63, #794bc4, #f45d22;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#theme-switch {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

#theme-switch:hover {
    transform: scale(1.1);
}

.dark-mode #theme-switch .fa-moon {
    display: none;
}

.dark-mode #theme-switch .fa-sun {
    display: block;
}

#theme-switch .fa-moon {
    display: block;
}

#theme-switch .fa-sun {
    display: none;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    filter: blur(30px);
    opacity: 0.3;
    border-radius: 50%;
    z-index: -1;
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.2;
    }
    100% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Card styles with glow effect */
.glow-card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, var(--glow-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.glow-card:hover::before {
    opacity: 1;
}

/* Search section */
.search-section {
    margin-bottom: 3rem;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.search-container h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.search-container p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px 0 0 12px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.glow-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 12px 12px 0;
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.glow-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.glow-btn:hover::before {
    left: 100%;
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 20px;
}

/* Loading section */
.loading-section {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

/* Results section */
.results-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.results-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.profile-container {
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-image-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1.5rem;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.profile-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h2 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.profile-info p {
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.verified {
    color: var(--accent-color);
    font-weight: 600;
}

.verified i {
    margin-right: 0.3rem;
}

.location i, .profile-joined i {
    margin-right: 0.3rem;
}

.profile-bio {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.profile-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

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

/* Analytics grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    height: 100%;
}

.analytics-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.engagement-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.engagement-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background-color: var(--bg-primary);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.engagement-item:hover {
    transform: translateY(-3px);
}

.engagement-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-right: 0.8rem;
}

.engagement-value {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.engagement-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chart-container {
    width: 100%;
    height: 250px;
}

/* Recent tweets */
.tweets-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.tweet-card {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.tweet-card:last-child {
    border-bottom: none;
}

.tweet-card:hover {
    background-color: var(--bg-primary);
}

.tweet-content {
    margin-bottom: 0.8rem;
}

.tweet-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tweet-stats {
    display: flex;
    gap: 1rem;
}

.tweet-stat {
    display: flex;
    align-items: center;
}

.tweet-stat i {
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.disclaimer {
    margin-top: 0.5rem;
    font-style: italic;
}

/* Cache notice */
.cache-notice {
    margin-bottom: 1.5rem;
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
}

.cache-notice-content {
    display: flex;
    align-items: center;
}

.cache-notice-content i {
    font-size: 1.5rem;
    color: #ffc107;
    margin-right: 1rem;
}

.cache-notice-content p {
    margin: 0;
    color: var(--text-primary);
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-image-container {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        border-radius: 12px;
        margin-bottom: 0.5rem;
    }
    
    .glow-btn {
        border-radius: 12px;
        padding: 1rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}
