:root {
    --bg-color: #ffffff;
    --text-color: #202124;
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --secondary-color: #f8f9fa;
    --secondary-hover: #f1f3f4;
    --border-color: #dfe1e5;
    --shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
    --bg-color: #202124;
    --text-color: #e8eaed;
    --primary-color: #8ab4f8;
    --primary-hover: #d2e3fc;
    --secondary-color: #303134;
    --secondary-hover: #3c4043;
    --border-color: #5f6368;
    --shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

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

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-right: 10px;
}

.theme-toggle:hover {
    background-color: var(--secondary-hover);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: space-between;
}

header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: #5f6368;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #5f6368;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* Header Controls (Theme Toggle + Hamburger) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    /* Use text color for dark mode adaptation */
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    flex-direction: column;
    background-color: var(--bg-color);
    /* Adapt to theme */
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: absolute;
    top: 73px;
    /* Height of header */
    left: 0;
    width: 100%;
    z-index: 9;
    box-shadow: var(--shadow);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-link {
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.mobile-nav-link:hover {
    background-color: var(--secondary-hover);
}

.mobile-nav-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background-color: var(--secondary-color);
    /* Subtle background for active state */
}

@media (max-width: 600px) {
    header {
        /* Keep header compact on mobile */
        flex-direction: row;
        padding: 15px 20px;
    }

    .logo-container {
        flex-grow: 1;
        /* Push controls to the right */
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.title {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-color);
}

.search-container {
    width: 100%;
    max-width: 584px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0 20px;
    margin-bottom: 30px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.input-wrapper:hover,
.input-wrapper:focus-within {
    box-shadow: var(--shadow);
    border-color: rgba(223, 225, 229, 0);
}

.input-group {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.country-code {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.input-group input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-color);
    background: transparent;
}

.input-group input::placeholder {
    color: #9aa0a6;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.terms-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.terms-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

.actions {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

.btn {
    background-color: var(--secondary-color);
    border: 1px solid transparent;
    border-radius: 4px;
    color: #3c4043;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    padding: 0 16px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    color: #202124;
}

.btn.primary {
    background-color: var(--secondary-color);
    /* Keep it subtle like Google Search buttons */
}

.btn.primary:hover {
    border: 1px solid #dadce0;
}

/* Active state for Start button to make it distinct when needed */
.btn.primary.active {
    background-color: var(--primary-color);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-area {
    width: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.status-area.hidden {
    display: none;
}

.status-item {
    margin-bottom: 15px;
    text-align: center;
}

.label {
    color: #5f6368;
    font-size: 0.9rem;
}

.value {
    font-weight: 600;
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

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

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #5f6368;
}

footer {
    background-color: var(--secondary-color);
    padding: 40px 30px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: #70757a;
    display: block;
    /* Changed from flex to block for grid container */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #70757a;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #9aa0a6;
}

[data-theme="dark"] footer {
    color: #9aa0a6;
}

[data-theme="dark"] .footer-section a {
    color: #9aa0a6;
}

[data-theme="dark"] .footer-section a:hover {
    color: var(--primary-color);
}

@media (max-width: 600px) {
    .title {
        font-size: 1.8rem;
    }

    footer {
        padding: 30px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
}

/* Legal Pages Styling */
.legal-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.8;
}

.legal-page h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.legal-page h2 {
    font-size: 1.5rem;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.legal-page h3 {
    font-size: 1.2rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.legal-page p {
    margin-bottom: 16px;
    color: var(--text-color);
}

.legal-page ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.legal-page li {
    margin-bottom: 8px;
    color: var(--text-color);
}

.legal-page a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-page a:hover {
    text-decoration: underline;
}

.legal-page section {
    margin-bottom: 32px;
}

.faq-item {
    margin-bottom: 32px;
}

.telegram-link,
.contact-link {
    font-size: 1.1rem;
}

.telegram-link {
    color: var(--primary-color);
    font-weight: 500;
}

@media (max-width: 600px) {
    .legal-page {
        margin: 20px auto;
    }

    .legal-page h1 {
        font-size: 2rem;
    }

    .legal-page h2 {
        font-size: 1.3rem;
    }
}