:root {
    --bg-color: #f0f2f5;
    --text-color: #333;
    --container-bg: #fff;
    --history-item-bg: #f9f9f9;
    --header-h2-color: #555;
    --btn-bg: #4a90e2;
    --btn-hover-bg: #357abd;
}

body.dark-mode {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --container-bg: #2e2e4f;
    --history-item-bg: #3a3a60;
    --header-h2-color: #bbbbbb;
    --btn-bg: #6c5ce7;
    --btn-hover-bg: #4b42b5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle, var(--text-color) 1px, transparent 1px);
    background-size: 20px 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 500px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header {
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.9);
}

.number-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.generate-btn {
    background-color: var(--btn-bg);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.generate-btn:active {
    transform: translateY(1px);
}

.history {
    margin-top: 2rem;
}

.history h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--header-h2-color);
    transition: color 0.3s ease;
}

.history-list {
    list-style: none;
    padding: 0;
}

.history-list li {
    background-color: var(--history-item-bg);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .number-display {
        gap: 0.5rem;
    }

    .generate-btn {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }

    .history h2 {
        font-size: 1.2rem;
    }

    .contact-form-section {
        margin-top: 2rem;
    }

    .contact-form-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: var(--header-h2-color);
    }

    .form-group {
        margin-bottom: 1rem;
        text-align: left;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--text-color);
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ccc;
        border-radius: 0.5rem;
        font-size: 1rem;
        background-color: var(--history-item-bg);
        color: var(--text-color);
        transition: border-color 0.3s ease, background-color 0.3s ease;
    }

    .form-group input[type="text"]:focus,
    .form-group input[type="email"]:focus,
    .form-group textarea:focus {
        border-color: var(--btn-bg);
        outline: none;
    }

    .contact-form-section .generate-btn {
        margin-top: 1rem;
        width: 100%;
    }
